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 (I've tested it with pymongo). But the code below doesn't find it: type id_cookie struct { IdCookie int } func get_id_mongo() int { session, err := mgo.Dial("127.0.0.1") if err != nil { panic(err) } defer session.Close() // Optional. Switch the session to a monotonic behavior. session.SetMode(mgo.Monotonic, true) c := session.DB("id_bag").C("id_cookie") data := id_cookie{} err2 := c.FindId(bson.M{"_id":