Hi Guys ,
This is karthick working as a software developer . Currently we are in the process of migrating our old mongo driver (global sign) to mongo-driver.
We are migrating from mgo.session(old) to *mongo.Client now .
In the old package that we were using we had a method called copy() in *mgo.Session which clones and gives us back the client details .
We maintain an interface like below and we don’t want to change the same structure or else we will have to do many changes in the service code .
Old Interface according to *mgo.Session mgo package - github.com/globalsign/mgo - Go Packages
type Session interface {
Copy() Session
SetMode(consistency mgo.Mode, refresh bool)
DB(name string) DataLayer
Close()
}
Do we have similar method like Copy() in mongo-driver’s *mongo.Client which we can replace in that place for cloning ? So that we can map that to our interface .
I do not see any method under the *mongo.Client which gives us back the client details . Or is there any other way that we can get back the client properties ?
Can Anyone please help me with this ?