You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@chaddjohnson that's by design right now. MongoDB aggregation can modify the shape of the document, so in general the output of the aggregation won't match the model's schema, so autopopulate won't work reliably. What are you trying to achieve with autopopulate for aggregations?
I was trying to select a random document from a collection using $sample which required use of aggregation. But I found a different (faster) approach which involves querying for a count and then using .find() and skipping a random number of documents.
Thanks for responding. I no longer have a strong use case for auto-population with aggregate queries.
Also, thanks so much for the autopopulate and for Mongoose. So super useful they are, and perfect.
Hi! Thanks for the great plugin.
I'd like to suggest autopopulation with aggregation queries. When I do an aggregate query, autopopulation does not seem to occur.
The text was updated successfully, but these errors were encountered: