1
main()

    const main = async () =>{
    const task = await Task.findById('614ac31e103d9c5329d38686')
    await task.populate('owner').execPopulate()
    console.log(task.owner)
}

execPopulate() 不是函数

4

1 回答 1

1

https://mongoosejs.com/docs/migrating_to_6.html#removed-execpopulate的变更日志,

该行应替换为

await task.populate('owner')
于 2021-09-30T05:02:22.210 回答