Find Documents in MongoDB

From the MongoDB cheat sheet ยท CRUD Operations ยท verified Jul 2026

Find Documents

Query and retrieve documents from collections

javascript
// Find all documents
db.users.find()

// Find with filter
db.users.findOne({ email: "john@example.com" })

// Find multiple with conditions
db.users.find({ 
  age: { $gte: 18 },
  status: "active" 
})

// Projection (select fields)
db.users.find(
  { age: { $gte: 21 } },
  { name: 1, email: 1, _id: 0 }
)
๐ŸŸข Essential - Most common MongoDB operation
๐Ÿ’ก findOne() returns first match only
๐Ÿ“Œ Use projection to reduce network transfer
โšก Create indexes for frequently queried fields
๐Ÿ”— Related: explain() to analyze query performance
crudreadquery

More MongoDB tasks

Back to the full MongoDB cheat sheet