On Fri, Apr 6, 2012 at 16:15, Jordan Orelli <jordan...@gmail.com> wrote:
> err, I guess I should clarify: I want to take the result of a query and
> turn it into json. Iter.Next is internally unmarhasling the data, but I
> don't actually need to unmarshal the returned documents into a struct; I
> just want to print the result to json.
Yeah, that's doable, and simple. Just using a map to load the document
from your query result, and then marshal the same map to json.
var m bson.M
err := query.One(&m)
... marshal m onto json ....
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I'm not absolutely sure of anything.