I\'m trying to use MongoDB to analyse Apache log files. I\'ve created a receipts collection from the Apache access logs. Here\'s an abridged summary of what my
receipts
You can do Dan's code with a collection reference:
function clean(collection) { collection.find().forEach( function(result) { var value = result.value; delete value._id; collection.update({_id: result._id}, value); collection.update({_id: result.id}, {$unset: {value: 1}} ) } )};