I want to save the result from an aggregation into a csv file.
Using the mongo cmd line tool I can do this to get the results I want:
db.compras.aggregate({ $group : { _id : "$data.proponente", total : { $sum : "$price" } }}
How would I translate this into a mongoexport command that saves results into a csv?
See Question&Answers more detail:os