我是 mongoDB 的新手,我有这样的虚拟字段
videoSchema.virtual('playURL').get(async function () {
return await getVideoURLbyId(this.video_id, true)
.then(res => res)
})
videoSchema.set('toObject', { virtuals: true })
videoSchema.set('toJSON', { virtuals: true })
我可以记录结果,但是在浏览器上显示时,结果显示为空playURL:{}。如何解决?
谢谢