, | Boolean matchQuery (
, [ | String root ]
) {

Determine whether a query selects a given document.

Arguments

| Object doc

The document to be examined.

| Object query

The query to test against the document.

optional
| String root

Indicates an offset document position. Permits testing a full query against a subdocument.

Return Values

Static Functions

, | Boolean matchLeaves ( ) {

Compare two MongoDB documents, lists or leaves for deep equality.

Arguments

Returns

, | Boolean matchSubquery ( ) {

Test a partial query against a subdocument. Expects the query specification for a single key, e.g. from { 'able.baker':{ $gt:4 } } the subquery is { $gt:4 }.

Arguments

| Object document

Subdocument or leaf to test.

| Object subquery

Query specification for a single key.

Returns