Skip to content

Instantly share code, notes, and snippets.

@willettk
Created May 29, 2014 22:11
Show Gist options
  • Save willettk/abe053d46dea687e66b1 to your computer and use it in GitHub Desktop.
Save willettk/abe053d46dea687e66b1 to your computer and use it in GitHub Desktop.
# Get the average classification counts for each group of subjects in Galaxy Zoo
db.galaxy_zoo_subjects.aggregate([{$group : {_id : "$metadata.survey", nClass : {$avg : "$classification_count"}}}])
# Export data from MongoDB to a CSV file from the shell command line
mongoexport --db ouroboros --collection galaxy_zoo_subjects --csv --fields classification_count --query '{"metadata.survey":"ukidss"}' --out ukidss_nclass.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment