new QueryIterator(documentclient, body)
Represents a QueryIterator Object, an implmenetation of feed or query response that enables traversal and iterating over the response.
Parameters:
Name | Type | Description |
---|---|---|
documentclient |
object | The documentclient object. |
body |
object | the JSON body. |
- Source:
Methods
current(callback)
Retrieve the current element on the QueryIterator.
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback | Function to execute for each element. the function takes two parameters error, element. |
- Source:
executeNext(callback)
Retrieve the next batch of the feed and pass them as an array to a function
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback | Function execute on the feed response, takes two parameters error, resourcesList |
- Source:
forEach(callback)
Execute a provided function once per feed element.
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback | Function to execute for each element. the function takes two parameters error, element. Note: the last element the callback will be called on will be undefined. If the callback explicitly returned false, the loop gets stopped. |
- Source:
hasMoreResults() → {Boolean}
Determine if there are still remaining resources to processs based on the value of the continuation token or the elements remaining on the current batch in the QueryIterator.
- Source:
Returns:
true if there is other elements to process in the QueryIterator.
- Type
- Boolean
nextItem(callback)
Execute a provided function on the next element in the QueryIterator.
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback | Function to execute for each element. the function takes two parameters error, element. |
- Source:
reset()
Reset the QueryIterator to the beginning and clear all the resources inside it
- Source:
toArray(callback)
Retrieve all the elements of the feed and pass them as an array to a function
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback | Function execute on the feed response, takes two parameters error, resourcesList |
- Source: