i would like to get the "-lists" data from an array with several objects:
[{...},{...},{...},{"-name": "Test", "-lists": [123, 456, 789]},{...}]
i tried with a filter function but it doesnt works :-(
this is the query where i would like to change the result to the value/array of "-lists"
.findOne({ _id: serviceID }, function (err, result) {
if (err) {
res.json(err);
} else {
try{
res.json(result.service.modules)
console.log(result.service.modules)
}catch(error){
console.log(error)
}
}
})
Have someone an idea for me?
Best regrads & stay healthy