Suggest an editImprove this articleRefine the answer for “How do you find a document in the DB?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To find a document in MongoDB, use `findOne()` and `find()`: `findOne()` returns the first document matching a condition, while `find()` returns a cursor - a set of documents that can be iterated over. **Key point:** both methods take a filter in parentheses - the search condition expressed as an object, `{ field: value }`.Shown above the full answer for quick recall.Answer (EN)ImageTo find a document in MongoDB, use `findOne()` and `find()`. ### Finding one document: ```js db.users.findOne({ name: "Alex" }) ``` Returns the **first document found** that matches the condition. ### Finding several documents: ```js db.users.find({ age: 25 }) ``` Returns a **cursor**, a set of matching documents (you can iterate over it or print it). ### How this works: - the parentheses take a **filter**, search conditions as an object, `{ field: value }` - `findOne()`, for a single result - `find()`, for multiple results So: searching in MongoDB is done via `findOne()` or `find()` with a filter on the fields you need.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.