Lesson 6 / 23
find() Basics
Fetch documents with find and findOne using empty and field-based filters.
find() everything
An empty filter {} matches every document in the collection.
db.users.find({})Filtering & findOne()
Pass a filter document to match specific fields. findOne() returns just the first match.
db.users.find({ role: "engineer" })
db.users.findOne({ name: "Grace Hopper" })pretty() for readability
mongosh prints results as formatted, readable JSON by default. In the older mongo shell, chain .pretty() after find().