In Mongoose, I am able to extract data that references another Collection.
For instance, I can do
Comment.find().populate('user').then(comment => {
//
})
such that comment
has all its normal fields (text
, createdAt
, etc.), but it is also populated with all the fields from user
, such that it now has comment.user.username
, comment.user.full_name
, etc.
How can I obtain the same with PyMongo
?