function getAllExperiences(){
return new Promise(function(resolve,reject){
Experiences.find({status:'live'},function(err,results){
if(err){
reject(err);
}
else
{
var finalResult = [];
results.forEach(function(objs){
objs.convertedPrice = 'aaaaaaaaaa';
finalResult.push(objs);
});
console.log(finalResult[0].convertedPrice)
console.log(finalResult)
resolve(finalResult);
}
});
});
}
i need to add element to every json object into foreach loop but not showing into console.log(finalResult). but when i console.log(data[0].convertedPrice) it display convertedPrice