Module: DocResult

API for Document Store retrieval operations.
Mixes In:
Source:

Methods

fetchAll() → {Array.<Object>}

Consume the current result set from memory (and flush it).
Source:
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() → {Object}

Consume a single result set document from memory (and flush it).
Source:
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() → {Array}

Returns the result set (without flushing) as a JavaScript Arrray.
Source:
Returns:
Type
Array