mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-17 09:25:32 +00:00
13 lines
293 B
Plaintext
13 lines
293 B
Plaintext
// OR
|
|
db.books.find( { $or: [{year: {$lte: 2008}}, {year: {$eq: 2016}}]} )
|
|
|
|
// AND
|
|
db.books.find( { $and: [{year: {$eq: 2008}}, {category: {$eq: "Fiction"}}]} )
|
|
|
|
// NOT
|
|
db.books.find( {$not: {year: {$eq: 2016} }})
|
|
|
|
// NOR
|
|
db.books.find( { $nor: [{year: {$lte: 2008}}, {year: {$eq: 2016}}]} )
|
|
|