【发布时间】:2022-01-27 00:21:16
【问题描述】:
我的 mongodb 文档包含对象 CarData,其中包含多个属性。
{
_id: ...,
Name: "",
CarData: {
carId: null,
ownerName: "",
ownerPhone: "",
AdditionalInfo:{
RefNr: ""
validDoc: true
}
}
}
我知道我可以查询整个集合
{ "CarData": { $exists: true } }
但我不知道如何查询整个集合
CarData exists and is not null
and ownerName != ""
and AdditionalInfo exists and != null
and AdditionalInfo.validDoc == true
【问题讨论】:
标签: mongodb mongoose mongodb-query