FAQ

Search Discussions

557 discussions - 2,033 posts

  • Greetings, sorry, If this has been asked before. But I couldn't find how to do `db.collection.count(query,options)` how can I do it in mgo? mgo support this? ...
    jeane paul Solivajeane paul Soliva
    Jun 15, 2016 at 1:58 am
    Jun 15, 2016 at 1:58 am
  • It seems that mgo doesn't support multiple operation yet? for an example http://stackoverflow.com/questions/5150061/mongodb-multiple-or-operations -- You received this message because you are ...
    Ribhararnus PracutianRibhararnus Pracutian
    May 24, 2016 at 9:15 am
    May 24, 2016 at 11:02 am
  • YouTube videos of U.S. Congress money laundering hearing of Saudi Billionaire " Maan Al sanea" with *bank of America* and The owner of Saad Hospital and Schools in the Eastern Province in *Saudi ...
    Mona fMona f
    May 17, 2016 at 10:58 pm
    May 17, 2016 at 10:58 pm
  • Hi! For some reason i get this error sometimes (or no such cmd:MaxDistance). Here is my code. It works mostly but then suddenly i get this error. Not sure if this is this is problem with mongodb ...
    Pontus LundinPontus Lundin
    May 17, 2016 at 8:45 am
    May 17, 2016 at 8:02 pm
  • original query with result: db.users.aggregate([{$unwind:"$rooms"}, {$project:{"name":"$rooms.name", "code":"$rooms._id", "users": "$rooms.users"}}, {$match:{"users":{$all:[ ...
    Poletaev RomanPoletaev Roman
    May 16, 2016 at 8:03 pm
    May 16, 2016 at 9:20 pm
  • Hi, what can be the reason for that error message ? The location pair seems to be added just fine into the slice. Thanks! type ShopLocation struct { ID bson.ObjectId `bson:"_id,omitempty" ...
    Pontus LundinPontus Lundin
    May 10, 2016 at 1:37 pm
    May 10, 2016 at 1:47 pm
  • I need to set a hard limit, not only on waiting for MongoDB to start returning documents, but even if it is taking to long to retrieve all the documents. I have some code that does this. I execute ...
    William KennedyWilliam Kennedy
    May 9, 2016 at 7:58 pm
    May 9, 2016 at 7:58 pm
  • Dear all, I think op.limit = -1 is suitable in query.One. When I set limit and offset = 1, I expect there is one result, but -1 make zero result. Is this an issue should be fixed ? Thanks! Ray -- You ...
    施舜元施舜元
    May 6, 2016 at 7:35 am
    May 6, 2016 at 7:35 am
  • Hi all, My environment is mongodb 3.2 and using latest mgo driver commit in v2-unstable (commit:0308d06). First, I found that the number of active connection ("SocketsInUse" observed from ...
    施舜元施舜元
    May 3, 2016 at 10:07 am
    May 3, 2016 at 10:07 am
  • Hi all, My environment is *mongodb 3.2* and using latest mgo driver commit in v2-unstable (commit:0308d06). First, I found that the number of connection is limited to only 1 when my api servers ...
    施舜元施舜元
    May 3, 2016 at 9:07 am
    May 3, 2016 at 9:07 am
  • Hi, I have something like this :- UsersDocument= mgo.Index{ Key: []string{"emailid", "purpose"}, Unique: true, DropDups: true, Background: true, Sparse: true, } But I want it to be compund index ...
    Melvin davisMelvin davis
    Apr 27, 2016 at 5:58 pm
    Apr 29, 2016 at 9:03 am
  • hi all, I'm having some problems querying inside an array. I'm trying to query a document based on whether a user is contained within an array //Subscription - struct type Subscription struct { ...
    Nick BeenhamNick Beenham
    Apr 26, 2016 at 7:29 pm
    May 16, 2016 at 7:51 pm
  • how to run a aggregate and then apply a mapreduce in result? pipe := []bson.D{...} db.C(name).Pipe(pipe). ? i knew that find query can chain mapreduce! However pipe? -- You received this message ...
    Jiang YuJiang Yu
    Apr 22, 2016 at 3:55 am
    Apr 22, 2016 at 6:57 am
  • Hello mgo developers, Besides mgo, this is one of the projects I've been working on the most lately: http://blog.labix.org/2016/04/16/snappy-ubuntu-core-2-0-is-out The platform is entirely written in ...
    Gustavo NiemeyerGustavo Niemeyer
    Apr 16, 2016 at 9:03 pm
    Apr 16, 2016 at 9:03 pm
  • Hello mgo developers, Besides mgo, this is one of the projects I've been working on the most lately: http://blog.labix.org/2016/04/16/snappy-ubuntu-core-2-0-is-out The platform is entirely written in ...
    Gustavo NiemeyerGustavo Niemeyer
    Apr 16, 2016 at 9:03 pm
    Apr 16, 2016 at 9:03 pm
  • I have 2 dosuments with id: "_id": { "$oid": "56980d05282c61b7d98baa51" } "_id": { "$oid": "56fecc86282c61b7d98bc7e1" } i want update both document fromUser := "56980d05282c61b7d98baa51" toUser := ...
    Poletaev RomanPoletaev Roman
    Apr 12, 2016 at 8:11 pm
    Apr 12, 2016 at 8:50 pm
  • Hey All, I'm trying to do some simple math in my aggregation. In particular: pipeline := []bson.M{ bson.M{"$unwind": "$log"}, bson.M{"$project": bson.M{ "_id": 0, ... "rate": bson.M{"$multiply" ...
    Walt NorbladWalt Norblad
    Apr 7, 2016 at 4:00 am
    Apr 16, 2016 at 2:53 am
  • type Room struct { Name string `bson:"name"` Code string `bson: "code` } type User struct { ID bson.ObjectId `bson:"_id,omitempty"` Name string `bson:"name"` Rooms []Room `bson:"rooms` } how to get ...
    Poletaev RomanPoletaev Roman
    Apr 6, 2016 at 9:13 pm
    Apr 7, 2016 at 4:26 pm
  • thx -- You received this message because you are subscribed to the Google Groups "mgo-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to ...
    Tianyi SongTianyi Song
    Apr 6, 2016 at 10:08 am
    Apr 6, 2016 at 10:08 am
  • Hi, I have an application that uses the java driver to save a java UUID as the _id on a collection. Then I have the string representation of the UUID in Go, and I need to search this collection to ...
    Diego MedinaDiego Medina
    Apr 5, 2016 at 5:40 am
    Apr 6, 2016 at 9:18 am
  • Hello! I have problem my model: package models import ( "gopkg.in/mgo.v2/bson" ) type ( Account struct { ID bson.ObjectId `bson:"_id",omitempty` Email string `bson:"email"` HashedPassword string ...
    Poletaev RomanPoletaev Roman
    Apr 1, 2016 at 7:15 pm
    Apr 1, 2016 at 7:25 pm
  • Hi, it 's my struct: type findingSchool struct { Id bson.ObjectId `_id` StudentNum map[string]string `bson:"年级人数构成"` E_des string `bson:"e_des"` Baseinfo findschBaseinfo `bson:"baseinfo"` ...
    LacLac
    Mar 21, 2016 at 3:28 am
    Mar 21, 2016 at 8:02 pm
  • Hi all, I am a newcomer go and mgo. How can I get nested field value with mgo? Original Mongo find result is below. { "_id" : { "tag" : "hoge", "org" : "fuga", "course" : "hoge", "category" : "fuga", ...
    Irt_m JrsyoIrt_m Jrsyo
    Mar 17, 2016 at 7:42 am
    Mar 18, 2016 at 9:40 pm
  • Hello, I have the following structs: type Record struct { RecordID string `json:"recordID" bson:"_id"` CreatedOn time.Time `json:"createdOn" bson:"created_on"` LastUpdatedOn time.Time ...
    Kris RunzerKris Runzer
    Mar 14, 2016 at 10:23 pm
    Mar 15, 2016 at 1:19 pm
  • Hi, I'm trying to retrieve multiple documents using mgo, I've seen an example here <http://stackoverflow.com/questions/26428281/ using $in like : *query := bson.M{"_id": bson.M{"$in" ...
    Tristan PironTristan Piron
    Mar 8, 2016 at 9:40 pm
    Mar 8, 2016 at 9:45 pm
  • Hi there, Some good news regarding our testing setup. Last week the proper setup was put in place to have every push and every pull request of mgo be tested against MongoDB 2.2, 2.4, 2.6, 3.0, and ...
    Gustavo NiemeyerGustavo Niemeyer
    Mar 7, 2016 at 2:44 pm
    Mar 7, 2016 at 2:44 pm
  • Hello, I need to search documents from a collection based upon datetime i.e using $lt and $gt, I am storing date in this format ISODate("2015-12-31T06:45:49.832Z") and my query is like this str := ...
    Vineet danielVineet daniel
    Mar 4, 2016 at 1:00 pm
    Mar 4, 2016 at 1:39 pm
  • hello, I am trying to retrieve all posts that are greater than <date but all i get is empty result set. If i use the shell i get results. Most probably there is something that is wrong with the ...
    Vineet danielVineet daniel
    Mar 1, 2016 at 12:12 pm
    Mar 1, 2016 at 12:12 pm
  • Hi, I have a collection with the following documents: { _id: 1, tags: [ "abc", "xyz", "zyx" ] }{ _id: 2, tags: [ "xyz" ] }{ _id: 3, tags: [ "zyx" ] } How do I query for elements which has a tag - ...
    Anindya ChatterjeeAnindya Chatterjee
    Feb 28, 2016 at 12:25 pm
    Feb 29, 2016 at 7:51 am
  • Hello, I am using distinct to get unique values from a collection but the results are unordered, how can I add sorting or order to a distinct query ?? Regards Vineet Daniel Cell : +918527565696 ...
    Vineet danielVineet daniel
    Feb 25, 2016 at 10:30 am
    Feb 25, 2016 at 10:30 am
  • hello, I have to store multiple file names in the following format : imagearray[0]["img"] = "filename1" imagearray[0]["thumb"] = "thumb_filename1" imagearray[1]["img"] = "filename1" ...
    Vineet danielVineet daniel
    Feb 23, 2016 at 3:54 pm
    Feb 23, 2016 at 4:57 pm
  • Hi Everybody, I would need an help with the use of mgo with a replicaset cluster. I have 1 master and 1 secondary node (I tried also with 2 secondary nodes). I establish a connection using the master ...
    Andrea GardimanAndrea Gardiman
    Feb 22, 2016 at 8:56 am
    Feb 26, 2016 at 10:57 am
  • Hello Everyone, Is it normal for MongoDB to lose all the data stored in it whenever the Go program or the MongoDB daemon resets. I am working on my first application with MongoDB and able to insert, ...
    CaseyCasey
    Feb 18, 2016 at 3:21 pm
    Feb 18, 2016 at 11:45 pm
  • Hello All, I've written a custom SetBSON function that I'd like to test *without* needing to run mongodb. As you probably know, the function signature is: func (m *MyStruct) SetBSON(raw bson.Raw) ...
    Chris MoeselChris Moesel
    Feb 16, 2016 at 11:30 pm
    Feb 17, 2016 at 1:17 pm
  • Is there any way to pass the "explain" option to a Pipeline command https://docs.mongodb.org/v3.0/reference/method/db.collection.aggregate/ -- You received this message because you are subscribed to ...
    William KennedyWilliam Kennedy
    Feb 16, 2016 at 7:21 pm
    Feb 16, 2016 at 8:22 pm
  • Hello, How can we write similar query in Go (mgo) : db.followers.aggregate([ {$match: { fserid: ObjectId("56b329fa2620e5438555992a")} }, {$lookup: { from: "users", localField: "fuserid", ...
    Vineet danielVineet daniel
    Feb 8, 2016 at 6:24 pm
    May 26, 2016 at 6:32 pm
  • It would be nice if mgo came with built-in support for context.Context: https://godoc.org/golang.org/x/net/context Although mgo has support for timeouts, they don't always work as expected when the ...
    Rob SRob S
    Feb 7, 2016 at 9:32 pm
    Feb 7, 2016 at 9:32 pm
  • I'm seeing a panic in a goroutine forked within mgo v2 when DialWithTimeout fails in server.go. Here's the offending code at https://github.com/go-mgo/mgo/blob/v2/server.go#L164 conn, err = ...
    Jack GreenfieldJack Greenfield
    Feb 6, 2016 at 7:06 pm
    Feb 8, 2016 at 10:24 pm
  • Hello Go & MongoDB developers, Happy to announce this major release, feature packed: http://blog.labix.org/2016/02/04/mgo-r2016-02-04 Thanks so much to all contributors. gustavo @ http://niemeyer.net ...
    Gustavo NiemeyerGustavo Niemeyer
    Feb 4, 2016 at 7:49 pm
    Feb 4, 2016 at 7:49 pm
  • I have a read-heavy load, so I am trying to distribute the reads by setting the mode to Eventual. Not surprisingly, this results in the primary sitting idle, since writes are very infrequent. Is ...
    PkaedingPkaeding
    Jan 29, 2016 at 7:16 pm
    Jan 29, 2016 at 7:16 pm
  • Hi If I set the mode on a session to `mgo.Eventual`, and then I run an aggregation framework pipeline, I expect it to run on one of my secondary nodes in the replicaset, but I'm seeing a load spike ...
    PkaedingPkaeding
    Jan 29, 2016 at 2:20 am
    Jan 29, 2016 at 2:20 am
  • Hi! I'm trying to create a document which expires. I'm setting up the keys, I think correctly, there is very little to go on. After I think I was successful in setting up a date field, I'm waiting ...
    Gergely BrautigamGergely Brautigam
    Jan 28, 2016 at 8:40 pm
    Jan 29, 2016 at 8:21 am
  • Hi, I have searched in the archive and I couldnt find, is there a way to have optional query and in mgo, similar to rogue(scala), in rogue you can do something like: MyCollection.where(_.title eqs ...
    Juan Jose OliveraJuan Jose Olivera
    Jan 27, 2016 at 8:50 pm
    Feb 1, 2016 at 3:31 pm
  • If I create a transaction operation that attempts to add a key with a leading "$" character (I know this is invalid, please bear with me), when the transaction is run, I receive the following error ...
    Keith BurtonKeith Burton
    Jan 20, 2016 at 10:36 am
    Jan 20, 2016 at 10:36 am
  • We've come across a scenario were we noticed a percentage of our find requests will randomly start failing with "not found" (using the same query over and over). Our structs look as follows: type ...
    Kris RunzerKris Runzer
    Jan 19, 2016 at 6:15 pm
    Jan 21, 2016 at 4:20 pm
  • As stated in the title -- You received this message because you are subscribed to the Google Groups "mgo-users" group. To unsubscribe from this group and stop receiving emails from it, send an email ...
    Chaisy127Chaisy127
    Jan 4, 2016 at 10:07 am
    Jan 4, 2016 at 1:53 pm
  • Hello, I’m trying to iterate over bunch of items var item Item iter := col.Find().Batch(1).Iter() for iter.Next(&item) { ... // This works } var itemArray [10]Item iter := col.Find().Batch(10).Iter() ...
    Sundar VSundar V
    Jan 2, 2016 at 9:54 am
    Jan 3, 2016 at 11:48 am
  • Hi guys! New year is coming, but I was confused by `bson:"_"` usage in anonymous field. Here is my example code: type Bstruct struct { X int `bson:"_"` Y int `bson:"_"` } type Astruct struct { ...
    Wei HeWei He
    Dec 31, 2015 at 3:31 am
    Dec 31, 2015 at 6:53 am
  • I have come across a behavior which I *think* is not intended. When using a tailable cursor on a capped collection in a replica set and this replica set fails over (i.e. the current primary is ...
    Markus MahlbergMarkus Mahlberg
    Dec 22, 2015 at 2:36 pm
    Jan 6, 2016 at 3:28 pm
  • Hello there, I've just finished pushing some deep changes into how mgo delivers queries to 3.2+ servers. If you have the time and environment, please test your code bases with a 3.2 server and the ...
    Gustavo NiemeyerGustavo Niemeyer
    Dec 21, 2015 at 4:39 pm
    Jan 6, 2016 at 3:29 pm
Group Navigation
period‹ prev | Latest | first ›
Group Overview
groupmgo-users @
categoriesmongodb
discussions557
posts2,033
users377
websitelabix.org...
irc#mongodb

Top users

Gustavo Niemeyer: 742 posts Nguyên Nguyễn Văn Cao: 28 posts Sankar: 27 posts Klaus Post: 26 posts William Kennedy: 25 posts Sundar Vadivel85: 23 posts Travis Reeder: 21 posts Evan Shaw: 20 posts Darko Luketic: 18 posts Alexander Luya: 18 posts Jeff Mitchell: 16 posts Athiwat Chunlakhan: 14 posts Islan Dberry: 13 posts Nz: 12 posts Tobias Contreras: 12 posts Poletaev Roman: 12 posts Sc28: 11 posts Chandra Sekar S: 11 posts Seller2k: 10 posts Tim Shannon: 10 posts
show more