[ANN] mgo r2011.09.15 supporting MongoDB 2.0.0

44 views
Skip to first unread message

Gustavo Niemeyer

unread,
Sep 14, 2011, 11:22:13 PM9/14/11
to golang-nuts, mongod...@googlegroups.com, mgo-...@googlegroups.com
Greetings,
Following the release of MongoDB 2.0.0, here is a freshnew release of
the mgo MongoDB driver for Go to join it.The project page with details
is available at:
    http://labix.org/mgo
Release r2011.09.15 is almost entirely compatible withthe previous
release (see below), and brings a few othergoods besides the
compatibility with MongoDB 2.0.0.
The changes made are:
- Support for the new write modes for datacenter/rack  awareness
settings via the WMode and J flags in mgo.Safe.  This enables logic
such as this in MongoDB 2.0.0:
      session.SetSafe(mgo.Safe{WMode: "majority"})
  Or also custom modes such as:
      session.SetSafe(mgo.Safe{WMode: "brazil"})
  Due to the new fields in mgo.Safe, existing code that  did not use
the field names when constructing values  will have to be fixed. Use
the field names in those  cases, to avoid future issues.
  Check the documentation for details:
      http://goneat.org/lp/mgo#Session.SetSafe
http://goneat.org/lp/mgo#Safe

- 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.

Gustavo Niemeyer

unread,
Sep 14, 2011, 11:24:18 PM9/14/11
to golang-nuts, mongod...@googlegroups.com, mgo-...@googlegroups.com
[Something strange happened to the text.. trying again]

Greetings,

    http://labix.org/mgo

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:

Reply all
Reply to author
Forward
0 new messages