heterogeneous bulk update in mongodb

前端 未结 3 1951
甜味超标
甜味超标 2021-02-14 22:58

I know that we can bulk update documents in mongodb with

db.collection.update( criteria, objNew, upsert, multi )

in one db call, but it\'s homo

3条回答
  •  遥遥无期
    2021-02-14 23:13

    we are seeing some benefits of $in clause. our use case was to update the 'status' in a document for a large number number records. In our first cut, we were doing a for loop and doing updates one by 1. But then we switched to using $in clause and that made a huge improvement.

提交回复
热议问题