mongoexport aggregate export to a csv file
Slightly simpler option as of 2.6+ is to now add an $out step to your aggregate to put the results into a collection: db.collection.aggregate( [ { aggregation steps… }, { $out : “results” } ] ) Then just use mongoexport as: mongoexport -d database -c results -f field1,field2,etc –csv > results.csv After that you might … Read more