From 94b96f2e0490863a2bcf98175a4a6df18e171c91 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Mon, 1 Feb 2016 16:55:43 +0100 Subject: [PATCH] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4103949..171dd35 100755 --- a/README.md +++ b/README.md @@ -271,7 +271,10 @@ db.find({ planet: { $regex: /ar/, $nin: ['Jupiter', 'Earth'] } }, function (err, ``` #### Array fields -When a field in a document is an array, NeDB first tries to see if the query value is an array to perform an exact match, then whether there is an array-specific comparison function (for now there is only `$size` and `$elemMatch`) being used. If not, the query is treated as a query on every element and there is a match if at least one element matches. +When a field in a document is an array, NeDB first tries to see if the query value is an array to perform an exact match, then whether there is an array-specific comparison function (for now there is only `$size` and `$elemMatch`) being used. If not, the query is treated as a query on every element and there is a match if at least one element matches. + +* `$size`: match on the size of the array +* `$elemMatch`: matches if at least one array element matches the query entirely ```javascript // Exact match