After looking into the sourcecode of mongoose, I solved this with:
var populateQuery = [{path:'books', select:'title pages'}, {path:'movie', select:'director'}];
Person.find({})
.populate(populateQuery)
.execPopulate()
More Related Contents:
- Mongoose and multiple database in single node.js project
- MongoDB, remove object from array
- Mongoose auto increment
- Simplest way to wait some asynchronous tasks complete, in Javascript?
- Mongoose, Select a specific field with find
- How to sort in mongoose?
- Mongoose difference between .save() and using update()
- Mongoose the Typescript way…?
- Bulk upsert in MongoDB using mongoose
- mongoose .find() method returns object with unwanted properties
- How to exclude some fields from the document
- Mongoose subdocuments vs nested schema
- Why is an _id with ObjectID added to when using MongoDB’s $push to add new object to an array?
- Why is my function returning Promise { } [duplicate]
- How to set _id to db document in Mongoose?
- What is a TransientTransactionError in Mongoose (or MongoDB)?
- Mongoose.js: Find user by username LIKE value
- How to solve Mongoose v5.11.0 model.find() error: Operation `products.find()` buffering timed out after 10000ms”
- Mongoose Not Creating Indexes
- Mongoose populate with array of objects containing ref
- is there a mongoose connect error callback
- Trying to hash a password using bcrypt inside an async function
- Node.js mongodb driver async/await queries
- Mongoose schema within schema
- Find after populate mongoose
- Object.keys() returns unexpected keys on MongoDB object from collection [duplicate]
- Multiple schema references in single schema array – mongoose
- JavaScript NoSQL Injection prevention in MongoDB
- Random document from a collection in Mongoose
- MongooseError: Model.findOne() no longer accepts a callback at Function