globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Possible to surcharge SetBSON #180

Closed Sata51 closed 6 years ago

Sata51 commented 6 years ago

Hi,

Is it possible to provide a way to override SetBSON with custom method ?

We are currently in a multi-database environment, one for each client. We want to set the database from where the entity come on-the-fly in the deserialization process.

Thanks

domodwyer commented 6 years ago

Hi @Sata51

Check out the bson.Setter interface.

Usage questions are probably best on stack overflow - we try to use the issue tracker for bugs and improvements.

Dom