4
我用$elementMatch
對用戶採集查詢:
Template.AccountInfo.helpers({
counter() {
return Meteor.users.find({
accounts: {
$elementMatch: {
bal: {
$exists: false
}
}
}
}).fetch();
},
});
此查詢工作正常的服務器,但客戶端我只得到下面的錯誤。什麼可能是錯的?
Exception in template helper: Error: Unrecognized operator: $elementMatch ...
作爲MasterM寫波紋管,也許你在代碼中有一個錯字:$ elemMatch而不是$ elementMatch。 mongodb文檔注意到,如果您在$ elemMatch表達式中只指定一個條件,則不需要使用$ elemMatch。 –