Announcing mgo r2011.04.13, with indexing helpers

34 views
Skip to first unread message

Gustavo Niemeyer

unread,
Apr 13, 2011, 12:56:42 AM4/13/11
to golang-nuts, mgo-...@googlegroups.com, mongod...@googlegroups.com
Version r2011.04.13 is out with a few new features for the MongoDB
driver for Go:

http://labix.org/mgo

Here is a summary of changes:

- New index handling methods:

http://goneat.org/lp/mgo/#Collection.EnsureIndexKey
http://goneat.org/lp/mgo/#Collection.EnsureIndex
http://goneat.org/lp/mgo/#Collection.DropIndex
http://goneat.org/lp/mgo/#Collection.GetIndexes
http://goneat.org/lp/mgo/#Session.ResetIndexCache

- Shifting between Strong, Monotonic, and Eventual consistency modes
is now done through the Session.SetMode method. The new method
has more clearly defined and documented semantics regarding what
happens when a mode change occurs. The overall behavior of the
consistency modes remains the same. More tests were added around
that area as well, and a GetMode method for consulting the
current consistency setting was introduced.

Check the relevant documentation for details:

http://goneat.org/lp/mgo/#Session.SetMode
http://goneat.org/lp/mgo/#Session.GetMode

- New method to obtain the set of servers discovered and currently
known to be alive in the cluster:

http://goneat.org/lp/mgo/#Session.GetLiveServers

- Fixed gobson bug which caused it to encode the value uint8(0)
as an int64 BSON value. Thanks to kar for reporting.

- When given a choice, gobson now decodes BSON int32s as Go ints
since that's much more convenient and expected.

- More documentation improvements.


--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/blog
http://niemeyer.net/twitter

Gustavo Niemeyer

unread,
Apr 13, 2011, 12:17:42 PM4/13/11
to golan...@googlegroups.com, dbd...@live.com, mgo-...@googlegroups.com
Hi there,

> I read the documentation for EnsureIndex, but I cannot figure out how to
> create a spatial index.  Can you please give an example?

Hmm, I've overlooked spatial indexing support. Let me fix that
tonight and I'll do a quick interim release with that in place so you
can use it.

The existing interface will not change though, so you can use the API
for any other indexing work and it will remain compatible.

Sorry about that, and speak to you soon.

Gustavo Niemeyer

unread,
Apr 13, 2011, 6:03:15 PM4/13/11
to golan...@googlegroups.com, dbd...@live.com, mgo-...@googlegroups.com
> Hmm, I've overlooked spatial indexing support.  Let me fix that
> tonight and I'll do a quick interim release with that in place so you
> can use it.

Support for geospatial indexes was just pushed:

http://goneat.org/lp/mgo/#Collection.EnsureIndex

Please let me know if it works well for you.

Reply all
Reply to author
Forward
0 new messages