[英]Not able to pull from Mongo db using Morphia - No usable constructor
[英]not able to fetch using $and in mongo db
我正在尝试使用 $and 在 mongodb 缝合 function 中使用 2 个不同的条件获取数据
data = col.find( { $and: [ { "title": { title } }, { "address.countryName": { country } } ] } ).toArray;
但这显示 $undefined:true 作为响应。
请指导这里有什么问题
您需要删除条件值中的{}
db.getCollection('test').find({
$and: [
{
"title": 'title' --> Here
},
{
"address.countryName": 'country' --> Here
}
]
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.