db.users.findOne({email: 'a@b.com'})

Category: Databases & SQL

db.users.findOne({email: 'a@b.com'})

Return a single matching document

Like find but returns the first match as a plain object, which is convenient for lookups. Returns null when nothing matches. Related: find with .limit(1).
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.