Find documents. By default, documents are tested
for value equality with lodash.isEqual
.
This can be changed using a $test
function.
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 documentoptions
type object, how to do the lookupoptions 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 argumentdoc
document object foundkey
property of fields
to be testedoptions
the options object passed in to find
defaults
options.$test
an equality test using lodash.isEqual
returns o.$result