How can I dump an entire MongoDB database as text (plain text, json, or CSV)?
I'm using an application I'm not too familiar with. I'd like to
then diff the two!
Using mongodump
and bsondump
:
Step 1 Dump the entire database to BSON files:
mongodump --db db1
Step 2 Convert each BSON file to JSON file:
for f in dump/db1/*.bson; do bsondump "$f" > "$f.json"; done
Hope it's helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With