how to test existance of key in document mongo code example Example: mongodb exists db.records.find( { a: { $exists: true } } )