My document is the following
{
"name":"Name1",
"status":"active",
"points":[
{
"lag":"final"
},
{
"lag":"final"
}
]
},
{
"name":"Name2",
"status":"active",
"points":[
{
"lag":"final"
},
{
"lag":""
}
]
}
I need to get all the documents that have some value in the lag field, for this example should get two document,
I tried with this query, but it only returns me when all points have full lag
{ "points.lag":{$not:{ $eq:"" }},status:{$in:['active']}}
question from:
https://stackoverflow.com/questions/65895395/how-to-filter-the-fields-of-a-document-within-another-document-in-mongodb 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…