lihaibh / ditto

NPM library that helps managing MongoDB snapshots easily and efficiently
https://www.npmjs.com/package/mongodb-snapshot
MIT License
48 stars 6 forks source link

View bson File #14

Closed danielehrhardt closed 3 years ago

danielehrhardt commented 3 years ago

Hi, i really like this Package. Thank you! Is the a way to extract the .tar File and View the bson Files? Sometimes it is good to check if the Date is like we need before a restore.

Best, Daniel

lihaibh commented 3 years ago

in order to extract the tar file you can run the command:

tar -xvf ./dump.tar -C ./mydir

basically inside you will see bson file and metadata.json files per collection

danielehrhardt commented 3 years ago

Ah, sorry I saw that my Question is a bit confusing. I mean how to open the bson File. I tried it with several File Editors but there is only wired output.

lihaibh commented 3 years ago

bson is binary json i think there are tools that can help you convert bson to json, try to look for bsondump. I can add support to dump json files instead of bson but it will require more development.

danielehrhardt commented 3 years ago

Thank you!