Closed mariohmol closed 7 years ago
Forget about it.. found that mongoose itself can do it, exemple
.populate({
path: 'order',
populate: {
path: 'buyers',
select: {'users': 1},
model: 'Buyer',
populate: {
path: 'users',
select: {'email': 1},
model: 'User'
}
}
})
bests!
Hi there!
I have kind of cascading collections and i would like to take just one atribute at the end of the chain. Instead it is taking all the fields for the hole chain.
For example, i have:
Chat -> Order -> Sellers -> Users -> email
This brings me all the data for the order, seller and users, and not just the email for the user.
Is it possible to achieve that with deep-populate?
Tested whitelist as well but didnt worked, ex:
Thanks!