Mongoose: multiple query populate in a single call

You achieve that by simply passing object or array of objects to populate() method.

const query = [
    {
        path:'books', 
        select:'title pages'
    }, 
    {
        path:'movie', 
        select:'director'
    }
];
const result = await Person.find().populate(query).lean();

Consider that lean() method is optional, it just returns raw json rather than mongoose object and makes code execution a little bit faster! Don't forget to make your function (callback) async!


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()

you can also do something like below:

{path:'user',select:['key1','key2']}