mase

find

Find documents. By default, documents are tested for value equality with lodash.isEqual. This can be changed using a $test function.

spec

function find([object fields, object options|function $test])

arguments

  • fields type object, document fields for lookup
  • $test type function that will test fields for each document
  • options type object, how to do the lookup

options properties

  • $acc type boolean, return value of the $test function
  • $test type function to tests fields against each document
  • $break type boolean for wether to break the search after a match
  • $result type array, result returned. Starts as empty

$test(fields, doc, key, options) arguments

  • fields object fields given as argument
  • doc document object found
  • key property of fields to be tested
  • options the options object passed in to find

defaults

returns o.$result