[英]how to filter the fields of a document within another document in mongodb?
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']}}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.