Filter a find() to get only the data I need

19 views
Skip to first unread message

Nejc Vukovic

unread,
Jan 12, 2016, 10:06:07 AM1/12/16
to Mongoose Node.JS ODM
Hi there all,

I have a question about boosting find queries:

I have a collection with 50+ documents. The documents have 15 key:value pairs but I need only the values on 6 of them.
Is there any way to give the find function a parameters which of the key value pairs I need?

Thank you for helping.

Regards!

Nejc Vukovic

unread,
Jan 12, 2016, 11:14:18 AM1/12/16
to Mongoose Node.JS ODM
Well I found the way to do it: with select() - for those that will seek for this info : http://mongoosejs.com/docs/api.html#query_Query-select

Missed before when I was looking throught the docs.

Sorry for bothering.

Regards.
Reply all
Reply to author
Forward
0 new messages