Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Announcing mgo r2011.08.02
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gustavo Niemeyer  
View profile  
 More options Aug 2 2011, 9:03 pm
From: Gustavo Niemeyer <gust...@niemeyer.net>
Date: Tue, 2 Aug 2011 22:03:49 -0300
Local: Tues, Aug 2 2011 9:03 pm
Subject: Announcing mgo r2011.08.02
Following the release r59 of Go, another quick update on the
mgo MongoDB driver for Go is available, including compatibility
fixes and a few additional goods.

The project page with details is available at:

    http://labix.org/mgo

The following changes were made in release r2011.08.02.

- The tag format for marshalled fields has been changed to
  follow the conventions established in release r59 of Go.
  The key name within the tag is now separated from flags
  using a comma, and flags have also been renamed.

  Here is a simple table for migration:

      "/c" => ",omitempty"
      "/s" => ",minsize"
      "/cs" => ",omitempty,minsize"
      "key" => "key"
      "key/c" => "key,omitempty"
      "key/s" => "key,minsize"
      "key/cs" => "key,omitempty,minsize"

  If provided with an old-styled tag, gobson will panic
  reporting the problem and will also inform the new
  spelling for the specific tag at hand.

  For more details, please see the documentation:

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

- The bson tag information can now be namespaced.  For
  example, the following is a valid tag with information for
  both the json and the bson packages:

      `bson:",omitempty" json:",omitempty"`

  Using the bson namespace is optional as long as the
  content of the tag, which should be fully oriented towards
  gobson, does not contain the ":" character.

- To improve consistency in the naming convention, the recently
  introduced GetRef methods have been renamed to FindRef, and
  GetLiveServers was renamed to LiveServers:

      http://goneat.org/lp/mgo#Session.FindRef
      http://goneat.org/lp/mgo#Database.FindRef
      http://goneat.org/lp/mgo#Session.LiveServers

- New ObjectId.Hex method to obtain the commonly wanted hex
  representation of the id, as requested by Travis Reeder:

      http://goneat.org/lp/gobson/bson#ObjectId.Hex

- ObjectId pointers may now be marshalled and unmarshalled
  properly by the json package, also requested by Travis:

      http://goneat.org/lp/gobson/bson#ObjectId.MarshalJSON
      http://goneat.org/lp/gobson/bson#ObjectId.UnmarshalJSON

- New DatabaseNames and CollectionNames methods, as requested
  by Fabian Reinartz:

      http://goneat.org/lp/mgo#Session.DatabaseNames
      http://goneat.org/lp/mgo#Database.CollectionNames

- New GridFile.UploadDate method, also requested by Fabian:

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

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

-- I never filed a patent.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Evan Shaw  
View profile  
 More options Aug 18 2011, 4:32 am
From: Evan Shaw <eds...@gmail.com>
Date: Thu, 18 Aug 2011 20:32:14 +1200
Local: Thurs, Aug 18 2011 4:32 am
Subject: Re: Announcing mgo r2011.08.02

On Wed, Aug 3, 2011 at 1:03 PM, Gustavo Niemeyer <gust...@niemeyer.net> wrote:
> - ObjectId pointers may now be marshalled and unmarshalled
>  properly by the json package, also requested by Travis:

>      http://goneat.org/lp/gobson/bson#ObjectId.MarshalJSON
>      http://goneat.org/lp/gobson/bson#ObjectId.UnmarshalJSON

I've got one further request here. Can these methods have value
receivers instead of pointer receivers?

As it is, if I have a struct with an ObjectId field, json fails to
marshal unless I turn the field into a pointer, which I'd prefer not
to do. With that small change, json marshals both pointers and values
correctly. (I haven't tested unmarshalling yet, but I assume it has
the same problem.)

- Evan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gustavo Niemeyer  
View profile   Translate to Translated (View Original)
 More options Sep 14 2011, 10:14 pm
From: Gustavo Niemeyer <gust...@niemeyer.net>
Date: Wed, 14 Sep 2011 23:14:19 -0300
Local: Wed, Sep 14 2011 10:14 pm
Subject: Re: Announcing mgo r2011.08.02
Hey Evan,

> I've got one further request here. Can these methods have value
> receivers instead of pointer receivers?

> As it is, if I have a struct with an ObjectId field, json fails to
> marshal unless I turn the field into a pointer, which I'd prefer not

I lost that request somehow when you mentioned it last month, but
looking over the list for pending things I got it, and will be in the
next release.

> to do. With that small change, json marshals both pointers and values
> correctly. (I haven't tested unmarshalling yet, but I assume it has
> the same problem.)

No, unmarshalling cannot change in that regard, otherwise we'd be
unable to set the id field to the unmarshalled value.

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

-- I never filed a patent.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Evan Shaw  
View profile  
 More options Sep 14 2011, 10:31 pm
From: Evan Shaw <eds...@gmail.com>
Date: Thu, 15 Sep 2011 14:31:51 +1200
Local: Wed, Sep 14 2011 10:31 pm
Subject: Re: Announcing mgo r2011.08.02

On Thu, Sep 15, 2011 at 2:14 PM, Gustavo Niemeyer <gust...@niemeyer.net> wrote:
> I lost that request somehow when you mentioned it last month, but
> looking over the list for pending things I got it, and will be in the
> next release.

Thanks!

>> to do. With that small change, json marshals both pointers and values
>> correctly. (I haven't tested unmarshalling yet, but I assume it has
>> the same problem.)

> No, unmarshalling cannot change in that regard, otherwise we'd be
> unable to set the id field to the unmarshalled value.

I realized that after I sent the email, but hoped you'd figure it out. ;)

- Evan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »