Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Created April 13, 2017 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpadilla/9ece3e32e005d244de657ac293756223 to your computer and use it in GitHub Desktop.
Save jpadilla/9ece3e32e005d244de657ac293756223 to your computer and use it in GitHub Desktop.
// Why is this so fast...
var batch = collection.initializeOrderedBulkOp();
batch.find(query).update(update);
batch.execute();
// Compared to this, which is timing out
collection.updateMany(query, update);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment