Mongo command to add a field to all documents in a collection This code appends a boolean column to all documents in the birds collection.

db.birds
  .find()
  .snapshot()
  .forEach(function(el) {
    el.hi = true
    db.birds.save(el)
  })


Here's how the command is run in production.

mongo db_stuff/db_name -u username -p password theScript.js


This command runs very slowly.  Should I look into the $set operator or something else that will speed this up?
This is a lot faster:

db. birds.updateMany(
   {},
   { $set:
      {
        hi: true
      }
   }
)