如何从异步函数向pug模板返回对象数组?

const Entry = mongoose.model('daily',entrySchema)

async function displayEntry(){
    let data = await Entry.find()
    console.log(data)
    return data
}

module.exports = { displayEntry : displayEntry }

///当我将displayEntry导入到新文档中并尝试在得到[对象承诺]的哈巴狗文档上显示数据时。我想我忘记了displayEntry函数中的某个步骤?

wazhyhc 回答:如何从异步函数向pug模板返回对象数组?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3085353.html

大家都在问