Skip to content

Instantly share code, notes, and snippets.

@dizda
Created May 4, 2013 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dizda/5519127 to your computer and use it in GitHub Desktop.
Save dizda/5519127 to your computer and use it in GitHub Desktop.
MongoDB Add field to all documents without criteria
db.TheCollection.update({}, {$set:{'parent':true}}, {multi:true});
// {} = empty selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment