Skip to content

Commit

Permalink
Update mongodb.html.markdown (#4358)
Browse files Browse the repository at this point in the history
fixed in: -> $in: and added $nin: too
  • Loading branch information
arnotixe committed Jan 23, 2024
1 parent f8c0fd4 commit 3ae5f34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mongodb.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 ///////////////////

Expand Down

0 comments on commit 3ae5f34

Please sign in to comment.