Mongoose multi update

后端 未结 3 915
囚心锁ツ
囚心锁ツ 2021-02-10 16:26

I want to update multiple docs with different values.

My Database looks something like this.

[
    {
        \"_id\": 1,
        \"value\": 50
    },
            


        
3条回答
  •  星月不相逢
    2021-02-10 16:42

    Multi update can be used only for updating multiple documents to the same value(s) or updating with the same update operation for all documents.

    If you want to update to different values you have to use several update statements.

提交回复
热议问题