Defines QueryCursor
(not exposed on baja
namespace).
new (require("baja/coll/QueryCursor"))(source, curData)
Cursor for a Query.
Extends:
Parameters:
Name | Type | Description |
---|---|---|
source |
baja.coll.QueryResult | |
curData |
Object |
Methods
-
after(func)
-
When the cursor is iterated, the before function will be called
just after iteration has finished.When the function is called,
this
refers to the Cursor. The Cursor is also
passed in as a argument to this function.Parameters:
Name Type Description func
function the after function.
-
before(func)
-
When the cursor is iterated, the before function will be called
just before iteration starts.When the function is called,
this
refers to the Cursor. The Cursor is also
passed in as a argument to this function.Parameters:
Name Type Description func
function the before function.
-
each(func)
-
Iterate through the Cursor and call a function for every item.
When the function is called,
this
refers to the Cursor.Parameters:
Name Type Description func
function function called on every iteration with
the current row used as the first argument and row
index as the second argument.- Overrides:
-
get()
-
Return the current row.
- Overrides:
Returns:
the cursor value (null if none available)
-
getSource()
-
Return the underlying Cursor's data source.
Returns: