Skip to content

Instantly share code, notes, and snippets.

@tianp
Created January 16, 2015 09:22
Show Gist options
  • Save tianp/90491f7792df1f9d4e58 to your computer and use it in GitHub Desktop.
Save tianp/90491f7792df1f9d4e58 to your computer and use it in GitHub Desktop.
Export MongoDB to CSV
mongoexport --host dbhost --port 27017 --collection coll --csv --fields field1,field2 --out filename.csv --db dbname --query '{}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment