Skip to content

Instantly share code, notes, and snippets.

@willettk
Created November 23, 2015 16:49
Show Gist options
  • Save willettk/6d897d92a5a78f0f782f to your computer and use it in GitHub Desktop.
Save willettk/6d897d92a5a78f0f782f to your computer and use it in GitHub Desktop.
Aggregate Zooniverse classifications in MongoDB by date
db.radio_classifications.aggregate(
{ $group : {
_id: {
year : { $year : "$created_at" },
month : { $month : "$created_at" },
day : { $dayOfMonth : "$created_at" },
},
count: { $sum: 1 }
}}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment