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.
You can now use (in an async function, of course):
for await (let doc of collection.find(query)) { await updateDoc(doc); } // all done
which nicely serializes all updates.