How can I use a cursor.forEach() in MongoDB using Node.js?

前端 未结 10 854
你的背包
你的背包 2020-11-27 14:04

I have a huge collection of documents in my DB and I\'m wondering how can I run through all the documents and update them, each document with a different value.

10条回答
  •  误落风尘
    2020-11-27 14:50

    None of the previous answers mentions batching the updates. That makes them extremely slow

提交回复
热议问题