Reputation: 1870
I have a database in mongodb, however, there's some field (userEmail
) in every collection, that I dont want to fetch it to the client side.
I expect it to be something like:
User.find(callback)
.limit(limit)
.omit('userEmail');
I couldnt find it anywhere in the docs.
Upvotes: 1
Views: 54
Reputation: 46451
You can use projection to limit your fields
User.find(callback).project({ userEmail: 0 }).limit(limit)
Upvotes: 1