How can you perform a dynamic document update in MongoDB? (from the terminal application mongo, not by having to use additional libraries like mongoose for nodejs)
My first attempt didn't seem to actually update anything:
db.people.find().forEach( function(myDoc) { myDoc.field = myDoc.field.replace(/\/./g, '/'); } );
The update documentation at http://docs.mongodb.org/manual/reference/method/db.collection.update/#update-parameter only seems to discuss "static" updates (so you can't use the exist value of a document's attribute to determine what the new value should be).
Do I need to use the MapReduce feature some how?