findAll

function
 findAll() 

Option name Type Description
[filter] Function

Function returning true for any object to be returned.

return Promise

finds all existing objects in local database.

function findAll (filter) {
  return this.allDocs({
    include_docs: true
  })

  .then(function (res) {
    var objects = res.rows
      .filter(isntDesignDoc)
      .map(function (row) {
        return toObject(row.doc)
      })

    return typeof filter === 'function'
      ? objects.filter(filter)
      : objects
  })
}