Skip to content

Instantly share code, notes, and snippets.

@oreillyross
Created January 25, 2015 15:04
Show Gist options
  • Save oreillyross/db42a7f178405cc5d479 to your computer and use it in GitHub Desktop.
Save oreillyross/db42a7f178405cc5d479 to your computer and use it in GitHub Desktop.
kind of got the solution.
cursor = db.students.aggregate(
[ { "$unwind": "$scores" },
{"$match": {"scores.type": "homework"}},
{"$group": { '_id':'$_id' , 'minitem': {'$min': "$scores.score" }}}
] );
db.students.update({'_id':19},{'$pull':{'scores':{'score':49.43132782777443}}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment