Explore Related Tools
Hand-picked utilities and calculators related to this tool.
Logical operators allow you to combine multiple query conditions to filter documents.
Matches documents where at least one of the conditions is true.
db.users.find({
$or: [
{ status: "A" },
{ age: { $lt: 30 } }
]
})Matches documents where all specified conditions are true. Note that MongoDB often performs an implicit `$and` when you provide multiple fields in a query.
// Explicit $and
db.users.find({
$and: [
{ status: "A" },
{ age: { $gt: 25 } }
]
})
// Implicit $and (Same result)
db.users.find({ status: "A", age: { $gt: 25 } })Inverts the effect of a query expression and returns documents that do not match the query expression.
// Find documents where age is NOT greater than 25
db.users.find({
age: { $not: { $gt: 25 } }
})Matches documents that fail all query conditions (The opposite of `$or`).
db.users.find({
$nor: [
{ price: 1.99 },
{ sale: true }
]
})Hand-picked utilities and calculators related to this tool.
