new QueryResult()
Represents a baja:QueryResult in BajaScript.
A QueryResult can be resolved from a NEQL query.
Members
-
<static> DEFAULT :baja.coll.QueryResult
-
Default
QueryResultinstance.Type:
Methods
-
cursor(obj)
-
Iterate through a QueryResult's Entities.
Please note, this may retrieve data asynchronously.
A callback function is passed in to retrieve the Cursor.
Parameters:
Name Type Description objObject | function the object literal that specifies the method's
arguments.Properties
Name Type Argument Default Description okfunction <optional>
(Deprecated: use Promise) called when the
cursor has been created with the cursor as an argument.failfunction <optional>
(Deprecated: use Promise) called if the cursor
fails to be retrieved. An error is passed in as the first argument.batchbaja.comm.Batch <optional>
if specified, the operation will be
batched into this object.beforefunction <optional>
called just before the Cursor is about to be
iterated through.afterfunction <optional>
called just after the Cursor has finished
iterating.offsetNumber <optional>
0 Specifies the row number to start encoding
the result-set from.limitNumber <optional>
10 Specifies the maximum number of rows that
can be encoded.Returns:
a promise that will be resolved once the cursor has been
retrieved.- Type
- Promise
Example
myQueryResult.cursor({ each: function () { // Called for each Entity in the Cursor... var dataFromCursor = this.get(); } }) .then(function (cursor) { // Called once we have the Cursor }) .catch(function (err) { // Called if any errors in getting data }); -
getQuery()
-
Return the Query string for the result.
Returns:
The Query.
- Type
- String
-
getScopeOrd()
-
Return the Scope ORD for the result.
Returns:
The Scope ORD.
- Type
- baja.Ord