Support for `mongodump` like output
I was wondering whether it would be possible to transform the output to mongodump-like output.
The benefit of this is that you can use mongorestore on the CLI if you wanted to restore to a database created using mongodb-backup, and similarly, it's be cool if mongodb-restore had the ability to read a normal mongodump folder.
This is what mongodump spits out
collectionA.bson
collectionA.meta.json //this file is not required but contains index data
collectionB.bson
collectionB.meta.json
...
And this is what mongodb-backup currently creates
collectionA/
_idA.bson
_idB.bson
collectionB/
_idC.bson
_idD.bson
...
Would it possible to add directional compatibility for mongodump and mongorestore by implementing this transformation?
cool idea it's a breaking change, but can be very useful!
however, if you need a *cli command, you can use mongodb-backup-cli and mongodb-restore-cli for the moment
Needn't be breaking! nativeOutput: true and nativeInput: true would work?
yes sure! for the moment output remains the same maybe (in the future) will be default
@hitchcott
If its still relevant my own solution for mongodb backup creates backup that is compatible with the native mongodump
you can basically use mongorestore to restore backups created by my library.
will appreciate contribution!
https://github.com/lihaibh/mongodb-snapshot