how to check key exists in mongodb code example Example: mongodb exists db.records.find( { a: { $exists: true } } )