假设我具有以下JSON
{
"name":"xpto",
"assets":[{
"name":"ypto",
"orders":[{
"client":"John",
}],
"dues": [{
"refMonth":"01/2019",
},{
"refMonth":"02/2019",
}]
},
{
"name":"tpto",
"orders":[{
"client":"John",
}],
"dues": [{
"refMonth":"01/2019",
},{
"baseDate":"02/2019",
}]
}]
}
我需要获取所有“ refMonth”字段,与父级无关。
我正在使用猫鼬,并且已经尝试过
MarketModel.findOne({"Name": req.params.market, "Assets.Name": req.params.asset}, callback)
,但它带给我整个json