I need only path in every object in the above showing figure. I tried something like this
userRouter.post('/delete_products',function(req,res){
Collections.product.find({ "_id": req.body.id }, { "pimages.path": "1" },function(err,result){
if(err)
res.send(err)
else
res.send(result)
const map=result.map(user=>user.pimages.map(user=>user.path))
console.log(map);
})
})
[ [ '1552640783_mixer front.jpg', '1552640783_mixer back.jpg' ] ]
I am getting like this. I am expecting output in array of object form
[{'1552640783_mixer front.jpg'},{......}]
Thanks in advance.
