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