-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.
Description
It could be good for performance if you add populate lean() to .populate() method itself. So if we use populate at now like the following:
Model.find({ type: 'paper' }).lean().populate('batch').exec(fn)
We get documents with type 'paper' as just JavaScript objects but 'patch' as fully functional mongoose document. It could be cool if we could make something like the following:
Model.find({ type: 'paper' }).lean().populate('batch', {lean: true}).exec(fn)
Now all documents are just JavaScript object. What do you think about it?
Metadata
Metadata
Assignees
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.