Mongodb Query To select records having a given key

To find if a key/field exists in your document use the $exists operator.

Via the MongoDB shell …

db.things.find( { ln : { $exists : true } } );

Leave a Comment