euberdeveloper / mongoback

The most powerful npm module to export and make backups of your MongoDB
https://mongoback.euber.dev
GNU General Public License v3.0
8 stars 1 forks source link

Added ability to use mongodump instead of mongoexport #17

Closed www-chique closed 2 years ago

www-chique commented 2 years ago

Added the ability to define a "method" configuration option, which is by default "mongoexport", but you can specify "mongodump" to use mongodump method instead. I followed the same pattern of your code more or less, but please excuse if I have missed anything.

I have made the necessary changes on the CLI method as well.

However, what I didn't have enough time to do was adding tests. Even though I ran tests to make sure everything works as usual and nothing breaks because of this change. Also, I didn't run the "docs:tree" because it was generating a lot of other extra things in the tree like documentations and licenses which I don't have much knowledge about. I'll leave this to you.

Let me know if there's something which I can help with.

To use the new ability, simply add a method: "mongodump" to the main configuration when calling mongoExport.

I really love the tool, and all the powerful configurations it supports. Having the ability of "mongodump" would be cherry on the cake.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

mongoback – ./

πŸ” Inspect: https://vercel.com/euberdeveloper/mongoback/BajgfijUq6RR5EFhNMwsMVzqKWJe
βœ… Preview: https://mongoback-git-fork-www-chique-mongodump-euberdeveloper.vercel.app

mongoback-dev – ./

πŸ” Inspect: https://vercel.com/euberdeveloper/mongoback-dev/BEnUNL8opxzeAhXYzAx9tBn5Gu1D
βœ… Preview: https://mongoback-dev-git-fork-www-chique-mongodump-euberdeveloper.vercel.app

euberdeveloper commented 2 years ago

I think I will be able to take a lot in depth on Thursday/Friday, but it seems good. The only thing is, do mongoDump and mongoexport have the same configuration/options? If they have not even the options should be differentiated and at that point maybe also creating a new method mongoDump() could be considered an option

www-chique commented 2 years ago

From the official docs of mongoexport and mongodump, indeed there are a few options which differ between them. Only in my specific case, I was content with the common options between both (many of them are common).

You are right, it's better off having a different function and options altogether to support everything. Take your time and do what you do the best.

I just did something to help showcase that it works :)

euberdeveloper commented 2 years ago

Yeah, it's also good code!

When I have time to check everything I'll merge the fix and add the mongoDump code in a new branch.

If you want I give you access as contributor

euberdeveloper commented 2 years ago

I close it because I merged it in another branch #19