new QueryIteratorWrapper()
Provides a wrapper for all the functions of QueryIterator that uses the Q module promise API instead of the callback model.
- Source:
Methods
current() → {Object}
Retrieve the current element on the QueryIterator.
- Source:
Returns:
The current resource in the QueryIterator, undefined if there isn't.
- Type
- Object
executeNextAsync() → {Object}
Retrieve the next batch of the feed and pass them as an array to a function
- Source:
Returns:
A promise object for the request completion. the onFulfilled callback is of type FeedResponse and onError callback is of type ResponseError
- Type
- Object
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
nextItemAsync() → {Object}
Gets the next element in the QueryIterator.
- Source:
Returns:
A promise object for the request completion. The onFulfilled callback is of type ResourceResponse and onError callback is of type ResponseError
- Type
- Object
reset()
Reset the QueryIterator to the beginning and clear all the resources inside it
- Source:
toArrayAsync() → {Object}
Execute a provided function on the next element in the QueryIterator.
- Source:
Returns:
A promise object for the request completion. the onFulfilled callback is of type FeedResponse and onError callback is of type ResponseError
- Type
- Object