- Clarified documentation for EnsureSafe:
http://goneat.org/lp/mgo#Session.EnsureSafe
- New BuildInfo method to obtain details about the running server.
This is useful to introduce logic dependent on the MongoDB release.
The BuildInfo.VersionArray field introduced in MongoDB 2.0+ will be
internally assembled using the
Version string for previous releases, so that logic like this
works:
info, err := session.BuildInfo() check(err) if
info.VersionArray[0] > 1 { ... }
For more details, check the documentation:
http://goneat.org/lp/mgo#Session.BuildInfo
http://goneat.org/lp/mgo#BuildInfo
- Other changes related to MongoDB 2.0.0 support.
- New DropDatabase and DropCollection methods:
http://goneat.org/lp/mgo#Database.DropDatabase
http://goneat.org/lp/mgo#Collection.DropCollection
Enjoy!
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I never filed a patent.
Greetings,
The changes made are:
session.SetSafe(mgo.Safe{WMode: "majority"})
session.SetSafe(mgo.Safe{WMode: "brazil"})
http://goneat.org/lp/mgo#Session.SetSafe
http://goneat.org/lp/mgo#Safe
http://goneat.org/lp/mgo#Session.EnsureSafe
in MongoDB 2.0+ is also internally assembled in previous
releases, enabling logic such as: