This was tested on:
- Ubuntu 14.04 x64
- Ubuntu 16.04 x64
# Type(<scope>): <subject> | |
# <body> | |
# <footer> | |
# Type should be one of the following: | |
# * feat (new feature) | |
# * fix (bug fix) | |
# * docs (changes to documentation) |
# | |
# Disable access to the entire file system except for the directories that | |
# are explicitly allowed later. | |
# | |
# This currently breaks the configurations that come with some web application | |
# Debian packages. | |
# | |
#<Directory /> | |
# AllowOverride None | |
# Require all denied |
var collection = db.getCollection('collectionName'); | |
var bulkOp = collection.initializeOrderedBulkOp(); | |
var count = 0; | |
collection.find().forEach(function(doc) { | |
bulkOp.find({ '_id': doc._id }).updateOne({ | |
'$set': { 'email': doc.email.replace('what to replace', 'replace with') } | |
}); | |
count++; | |
if(count % 100 === 0) { | |
// Execute per 100 operations and re-init |