The findOne() method returns only one document that satisfies the criteria entered. If the criteria entered matches for more than one document, the method returns only one document according to natural ordering which reflects the order in which the documents are stored in the database. MongoDB findOne() syntax is: db.collection.findOne(<criteria>, …
↧