Return only specific fields from matches.
Section: Projection, sort, and page
Project selected fields
javascript
javascript
db.users.find({ active: true }, { name: 1, email: 1, _id: 0 })Explanation
Projection can reduce payload size and improve clarity.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Projection, sort, and page