📜  mongoose virtual populate paginat - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:23.453000             🧑  作者: Mango

代码示例1
Post.find({})
.populate([
    // here array is for our memory. 
    // because may need to populate multiple things
    {
        path: 'user',
        select: 'name',
        model:'User',
        options: {
            sort:{ },
            skip: 5,
            limit : 10
        },
        match:{
            // filter result in case of multiple result in populate
            // may not useful in this case
        }
    }
])
.exec((err, results)=>{
   console.log(err, results)
})