Skip to content

Instantly share code, notes, and snippets.

@x
Created April 14, 2014 21:59
Show Gist options
  • Save x/10685685 to your computer and use it in GitHub Desktop.
Save x/10685685 to your computer and use it in GitHub Desktop.
dump contents of mongo collection to file
mongo HOST --eval "printjson(db.getSiblingDB('DB')['COLLECTION'].find().toArray())" >> output.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment