Projection
noun
say it: “pruh-JEK-shun” /prəˈdʒɛkʃən/
The part of a MongoDB query that picks which fields come back, so you don't fetch whole documents.
What is Projection?
A projection picks which fields to return, so you don't download whole documents.
db.recipes.find({}, { title: 1, minutes: 1, _id: 0 })
In a sentence
- “A projection of { password: 0 } leaves the password hash out of the result.”
- “The list page uses a projection to get only each vendor's name and stall.”
Level: Apprentice · More MongoDB terms at this level
Updated