summaryrefslogtreecommitdiffhomepage
path: root/mongodb.html.markdown
diff options
context:
space:
mode:
authorArno <arnotixe@gmail.com>2024-01-23 06:29:31 -0500
committerGitHub <noreply@github.com>2024-01-23 12:29:31 +0100
commit3ae5f34a91e8db6b73b5daea0d378337337ca4a8 (patch)
tree4b384aa5b130bfe273b60c02a1b5432ffd092bb5 /mongodb.html.markdown
parentf8c0fd4aeb7697ac1a6832d13e464cda8c982a37 (diff)
Update mongodb.html.markdown (#4358)
fixed in: -> $in: and added $nin: too
Diffstat (limited to 'mongodb.html.markdown')
-rw-r--r--mongodb.html.markdown5
1 files changed, 3 insertions, 2 deletions
diff --git a/mongodb.html.markdown b/mongodb.html.markdown
index 306f361c..eeb70265 100644
--- a/mongodb.html.markdown
+++ b/mongodb.html.markdown
@@ -264,8 +264,9 @@ db.engineers.find({ $lte: { age: 25 }})
db.engineers.find({ $eq: { age: 25 }})
db.engineers.find({ $ne: { age: 25 }})
-// Find all that match any element in the array
-db.engineers.find({ age: ${ in: [ 20, 23, 24, 25 ]}})
+// Find all that match any element in the array, or not in the array
+db.engineers.find({ age: { $in: [ 20, 23, 24, 25 ]}})
+db.engineers.find({ age: { $nin: [ 20, 23, 24, 25 ]}})
//////////////// Logical Operators ///////////////////