Top "Mgo" questions

mgo (pronounced as mango) is a MongoDB driver for the Go language that implements a rich and well tested selection of features under a very simple API following standard Go idioms.

partial update using mgo

I have the following problem. I need to convert a structure to map[string]interface{} in order to perform an …

go mgo
MongoDB in Go (golang) with mgo: How do I update a record, find out if update was successful and get the data in a single atomic operation?

I am using mgo driver for MongoDB under Go. My application asks for a task (with just a record select …

mongodb go mgo
Select column from Mongodb in golang using mgo

As I know, we can use > db['twitter-3'].find({}, {"text": 1}) to select all texts in collection. How can …

mongodb go mgo
Mongodb - aggregation $push if conditional

I am trying to aggregate a batch of documents. There are two fields in the documents I would like to $…

mongodb mongodb-query aggregation-framework mgo
Why does mgo not return the ID of inserted document?

According to the documentation (http://godoc.org/launchpad.net/mgo/v2) you can obtain the ID of your "Upserted" document …

mongodb go mgo
MongoDB in Go (golang) with mgo: how to use logical operators to query?

I would like to run the following query in golang using mgo in a pipeline. {"key1" : 1, "$or" : [{"key2" : 2}, {"key3" : 2}]} I …

mongodb go match logical-operators mgo
mgo convert bson.objectId to string(hex) in html template

I know this problem maybe duplicate to this one. But it hasn't get a satisfied answer till now. And I …

go mgo objectid go-html-template
How to marshal json string to bson document for writing to MongoDB?

What I am looking is equivalent of Document.parse() in golang, that allows me create bson from json directly? I …

mongodb go mgo
Unstructured MongoDB collections with mgo

I'm VERY new to Go. From what I've seen in the examples of mGo, in order to query a collection …

go mgo
mgo, mongodb: find one document that is embedded and part of an array

2 Parts to the question. 1 is the mongodb query itself, the next is how to do it in mgo. How do …

mongodb go mgo