You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the request! I'm curious to hear your use case for this outside of mongoist's existing bulk operation support and would be open to a PR implementing this operation.
In case you want to upsert many documents, you can do the following with those bulk operations:
varbulk=db.collection.initializeOrderedBulkOp()for(vardocofdocs)bulk.find({_id: doc._id}).upsert().updateOne(doc);// or use replaceOne()awaitbulk.execute();
db.collection.bulkWrite()
https://docs.mongodb.com/manual/reference/method/db.collection.bulkWrite/
The text was updated successfully, but these errors were encountered: