Answers for "mongodb null"

5

mongodb exists and not null

db.collection1.find({ 'fieldname1' : { $exists: true, $ne: null } });
Posted by: Guest on July-04-2020
1

mongodb query missing field

db.inventory.find( { item: null } )
Posted by: Guest on January-12-2021
0

mongodb find all that dont have property

db.things.find( { a : { $exists : false } } ); // return if a is missing
Posted by: Guest on November-18-2020

Browse Popular Code Answers by Language