Skip to content

Instantly share code, notes, and snippets.

@robyoung
Created November 1, 2010 14:46
Show Gist options
  • Save robyoung/658274 to your computer and use it in GitHub Desktop.
Save robyoung/658274 to your computer and use it in GitHub Desktop.
db.test.save({grouper:1, checker:false});
db.test.save({grouper:1, checker:false});
db.test.save({grouper:2, checker:false});
db.test.save({grouper:2, checker:false});
db.test.save({grouper:2, checker:false});
db.test.save({grouper:2, checker:false});
db.test.save({grouper:2, checker:false});
db.test.save({grouper:1, checker:false});
db.test.find({checker:false}).forEach(function(test) {
db.test.update({checker:test.checker}, {$set:{checker:true}}, false, true);
printjson(test);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment