1
我收到錯誤消息Uncaught Error: When the modifier option is true, validation object must have at least one operator
錯誤:試圖更新
我看similar的questions一個number時「未捕獲錯誤當改性劑的選擇是正確,驗證對象必須至少有一個運營商」,但一直沒能破譯這有什麼錯我的查詢:
Meteor.users.update({
_id: Meteor.user()._id
}, {
$set: {
"emails.letter": true
}
})
我的MongoDB的結構如下:
{
"_id": "ujkwQp4rYTKQeLq3F",
"emails": [{
"address": "[email protected]",
"letter": false
}]
}
我認爲你將'emails'定義爲一個數組,但是像'letter'這樣的行爲是屬性。嘗試取出括號,這樣'emails'是一個對象。這有幫助嗎? – terrafirma9
可能會有多封電子郵件,所有這些郵件都會有自己的驗證,所以我無法更改模型@ terrafirma9 – maudulus