Thuta Learning
IntermediateData & Databasesintermediate

Find One Document

Relax. We'll talk through this in plain words — no textbook voice.

Use the findOne() method to fetch just a single matching document.

javascript
db.inventory.findOne( { item: "paper" } )
You should see
{ _id: ObjectId("..."), item: 'paper', qty: 100, tags: [ 'white', 'blank' ] }