0
下以$ pushAll和簡單的賦值更新失敗:MongoDB的 - 我不能在同一時間
db.test.update({_id:102},{$pushAll:{our_days:["sat","thurs","frid"]}, country:"XYZ"}, {upsert:true})
錯誤消息:"Invalid modifier specified: country"
正確的方法似乎是:
db.test.update({_id:102},{$pushAll:{our_days:["sat","thurs","frid"]}, $set:{country:"XYZ"}}, {upsert:true})
那麼,在同樣的更新文檔中,我無法將諸如「$ pushAll」之類的修飾符與簡單賦值(如field:value)混合使用?相反,我必須使用$ set修飾符進行簡單賦值?
描述此行爲的文檔中是否有任何內容?