MongoDB: queries Find with regular expression db.getCollection('foo').find({"field": /.*test.*/}) Update or create field in all documents db.getCollection('foo').updateMany({}, {$set: {field: value}}) Remove field in all documents db.getCollection('foo').updateMany({}, {$unset: {field:1}}); Set field to value of another field in all documents db.getCollection('foo').find({}).forEach( function (elem) { db.getCollection('foo').update( { _id: elem._id }, { $set: { field1: elem.field2 } } ); } ); Update text field with javascript in all documents db.getCollection("foo").find({}).forEach(function(elem,i) { elem.field1 = elem.field1.replace("FOO ",""); db.getCollection("foo").save(elem); });