I'm new in mongoDB, I have virtual field like this
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 })
I can log the result but when show on browser, it shows empty result playURL:{}. How to fix it?
Thank you