Anthony Alaribe
1 min readAug 13, 2018

--

Hi Tarekk, I did that because in a lot of projects, everything revolves around a single database. So it removes the need to be constantly assigning the database. ie

db = scope.MgoSession.DB("dbName");

Also, you can clone/copy a session. The database still let’s you access the underlying session.

 Config{}.Database.Session.Clone()
Config{}.Database.Session.Copy()

So we can do things like

Config{}.Database.With(Config{}.Database.Session.Copy())

But still, you’re right, and i’ll think a bit more about this.

--

--

Anthony Alaribe
Anthony Alaribe

Written by Anthony Alaribe

I help solve business challenges using technology. Golang and Web optimisation (PWA, service workers, progressive enhancement)

No responses yet