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
> 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.
Support for geospatial indexes was just pushed:
http://goneat.org/lp/mgo/#Collection.EnsureIndex
Please let me know if it works well for you.