I am using MongoDB as database and mgo and mogo libraries in Go. I want to get a dump of my DB and restore it to write some utility methods to write unit test. my purpose is to dump the database then test my functions and after all restore it. Can you help me how can I do it using mogo or mgo?
There are mock libraries available which can be used to mock databases when creating test cases to check the database.No needs to dump database and run test cases on that. And then Restore to get your original data. Try this library
It is installing some packages for mongo db mock test cases