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
Creating another new Object or Array from data returned by find() will solve the problem . See below a simple illustration
app.get("/",(req,res)=>{
let com = require('./MODELCOM') // loading model
let source=fs.readFileSync(__dirname+"/views/template.hbs","utf-8");
com.find((err,data)=>{
// creation new array using map
let wanted = data.map(doc=>{
return {
name:doc.name,
_id:doc._id
}
})
let html= handlebar.compile(source);
fs.writeFileSync(__dirname+"/views/reciever.html",html({communities:wanted}))
res.sendFile(__dirname+"/views/reciever.html")
});