On Tue, Sep 17, 2013 at 2:01 AM, Daniel Mal <
daniel...@gmail.com> wrote:
> but, why the fields in struct saved with mgo are all lowercases, but when
> 'directly save with json', i got capitalized fields?
When mgo marshals a struct, it lowercases the fields by default
because that's by far the most common convention used with the MongoDB
database. If you want to use other casing, that's possible via the
`bson:"name"` field tag.
When you use a map, mgo won't touch the keys, though.
> is it still unmarshalable into a struct?
Yes, that's certainly fine.
gustavo @
http://niemeyer.net