Handlebars: Access has been denied to resolve the property “from” because it is not an “own property” of its parent

后端 未结 11 1824
我在风中等你
我在风中等你 2020-12-05 13:27

I am using a Nodejs backend with server-side rendering using handlebars. After reading a doc array of objects from handlebars, which contains key \"content\" an

11条回答
  •  抹茶落季
    2020-12-05 13:41

    A cleaner way to solve this issue is to use the mongoose document .toJSON() method.

    let data = dbName.find({})
      .exec(function(error, body) {
         //Some code
      });
        data = data.toJSON()
    //use {{data}} on .hbs template
    

提交回复
热议问题