API for Document Store retrieval operations.
- Mixes In:
Methods
-
fetchAll()
-
Consume the current result set from memory (and flush it).
Returns:
A list of documents.- Type
- Array.<Object>
Example
collection.find() .execute() .then(res => { // get the list of documents in the result set var docs = res.fetchAll() })
-
fetchOne()
-
Consume a single result set document from memory (and flush it).
Returns:
A document.- Type
- Object
Example
collection.find() .execute() .then(res => { // iterate over the documents in the result set while (var doc = res.fetchOne()) { // do something with the current document } })
-
toArray()
-
Returns the result set (without flushing) as a JavaScript Arrray.
Returns:
- Type
- Array