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.

How to construct an $or query in mgo

I am trying to convert this JS MongoDB query into Go mgo query: var foo = "bar"; db.collection.find({"$or": [ {…

go mgo
Find by id with mgo

I would like to find a data by _id. I know that this data exists and that this _id exist (…

mongodb go mgo
Using golang and mgo, how do I search for a range of values in MongoDB?

I worked through the example on the mgo homepage, but I'm struggling to find a way to query a range …

mongodb go mongodb-query mgo
i/o timeout with mgo and mongodb

I am running a map-reduce job from mgo. It runs on a collection with a little more than 3.5M records. …

mongodb go mgo
Go: how to run tests for multiple packages?

I have multiple packages under a subdirectory under src/, running the tests for each package with go test is working …

unit-testing go mgo
How to remove a single document from MongoDB using Go

I am new in golang and MongoDb. How can I delete a single document identified by "name" from a collection …

mongodb go mgo
Connections pool in Go mgo package

In the article running-mongodb-queries-concurrently-with-go said that mgo.DialWithInfo : Create a session which maintains a pool of socket connections to MongoDB, …

mongodb go mgo
MongoDB in Go with mgo, operators with bson.M / bson.D always got syntax error

It is kind of stupid syntax error, tried tons of ways, just couldn't get it work, someone please help. MongoDB …

mongodb go bson mgo
Connecting to MongoDB Atlas using Golang mgo: Persistent no reachable server to replica set

I have a replica set from MongoDB atlas, to which I can connect with ANY other language, and regular mongo …

mongodb go mgo replicaset
Efficient paging in MongoDB using mgo

I've searched and found no Go solution to the problem, not with or without using mgo.v2, not on StackOverflow …

mongodb go pagination mongodb-query mgo