Model.findOne().lean().populate(whatever).exec(...)the result will be a plain javascript object, right?
but, how can I use the lean option on model populate? for instance:
User.populate(user,{path:'messages'},function(err,user){...}); // I want user to be lean
user = user.toObject();--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
User.populate(user, { path: '..', options: { lean: true}},cb)
Need to update the docs.
On Wednesday, December 4, 2013, Edu wrote:
Hi--
Is it possible to use model populate and lean()?
I've read on the documentation thatModel.findOne().lean().populate(whatever).exec(...)the result will be a plain javascript object, right?
but, how can I use the lean option on model populate? for instance:User.populate(user,{path:'messages'},function(err,user){...}); // I want user to be lean
help please!
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.