[ANN] mgo r2011.08.21

22 views
Skip to first unread message

Gustavo Niemeyer

unread,
Aug 21, 2011, 12:40:37 AM8/21/11
to golan...@googlegroups.com, mongod...@googlegroups.com, mgo-...@googlegroups.com
Greetings,

Another update to the mgo MongoDB driver for Go was just
released. The project page with details is available at:

http://labix.org/mgo

Release r2011.08.21 is fully compatible with the previous
release of mgo, and is still compatible with the current
stable release of Go. The following changes were made:

- gobson now supports a new ",inline" tag for struct fields.
If it's used in a struct value field, all the fields of
the inner struct will be processed by gobson as if they
were in the outer struct. This enables more easily
composing types when the stored data has common fields
across several collections.

In the following example, a Programmer will be
marshalled as {"name": <str>, "cango": <bool>}:

type Person struct
Name string
}

type Programmer struct {
Person ",inline"
CanGo bool
}

More details in the documentation:

http://goneat.org/lp/gobson/bson#Marshal

- GridFile now implements a Seek method compatible with
os.File, allowing repositioning the file offset and
reading from arbitrary locations. More details at:

http://goneat.org/lp/mgo#GridFile.Seek

- The readahead logic within GridFile now prevents a potential
panic that might happen if the session was closed immediately
after Read was called in a chunk boundary and the background
readahead behavior was initiated.


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

-- I never filed a patent.

Reply all
Reply to author
Forward
0 new messages