我正在尝试在 mongoDB 中进行过滤,但没有得到预期的输出。我正在使用$elemMatch但仍然没有得到预期。代理集合[ { "_id": "5d402d36035f3063657240ac", "name": "test agency", "msisdn": "99961110278", "apps": [ { "pincodes": [ "135001", "122018" ], "_id": "5d402d36035f3063657240ae", "name": "DSB" }, { "pincodes": [ "135001", "122017" ], "_id": "5d402d36035f3063657240ad", "name": "DBH" } ], "__v": 0 }]在外壳上查询db.Agency.find({'apps':{$elemMatch:{name: {$regex: 'DSB', $options: 'i'} ,pincodes: { $in : ['135001','134002']}}}})
添加回答
举报
0/150
提交
取消