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