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