Skip to content

Instantly share code, notes, and snippets.

@mrgonza78
Created August 7, 2011 18:46
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 mrgonza78/1130639 to your computer and use it in GitHub Desktop.
Save mrgonza78/1130639 to your computer and use it in GitHub Desktop.
db.foo.insert({_id: 1, bars: { bar1: "a", bar2: "a" } })
db.foo.findAndModify({_id: 1},{ "$set": { bars.bar1: "b" } })
db.foo.findAndModify({_id: 1},{ "$set": { bars.bar2: "b" } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment