我有像
这样的数据库 "profile" : {
"firstName" : "dh",
"lastName" : "french",
"roles" : [
"applicant"
]
},
我想找到谁的角色是applicant
所以我试试这个查询
var data = Meteor.users.find({
"profile.roles": { $in: ["applicant"] }
}).fetch();
但我总是获得0长度数据 那么,哪个查询是正确的
答案 0 :(得分:2)
在这种情况下,您不需要使用 Meteor.users.find({
"profile.roles": "applicant"
}).fetch();
运算符。采取很容易:
selectedPersons = Person;