MongoDB Export Collection to CSV

/ Edit this post

Yes, that's right I am using my blog to post a sticky note to help me remember how to export mongo collection data.

$ mongoexport --host localhost --db dbname --collection name --csv --out data.csv --fields node1,node2,node3