MongoDB Export Collection to CSV

/ Edit this post / code

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

Eric David Smith

Father / Software Engineer / Musician / Recording Engineer / Navy Veteran / Runner / Javascript / Crypto / Human ETH: 0xa9FFaD2A2cA147F784f4C82Ee6475afb6765A974

Read More