2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-09 07:10:36 +00:00
cheat.sheets/sheets/_mongo/elements

7 lines
213 B
Plaintext
Raw Normal View History

2018-01-06 17:19:18 +00:00
// Match documents that contains that specified field
db.books.find( {category: {$exists: true }})
// Match documents whose field value is of the specified BSON data type
db.books.find( {category: {$type: 2 }})