(mode int, refresh bool)
| 86 | } |
| 87 | |
| 88 | func (this *MongoDBMgr) SetMode(mode int, refresh bool) { |
| 89 | status := mgo.Monotonic |
| 90 | if mode == Strong { |
| 91 | status = mgo.Strong |
| 92 | } else { |
| 93 | status = mgo.Monotonic |
| 94 | } |
| 95 | |
| 96 | this.session.SetMode(status, refresh) |
| 97 | } |
| 98 | |
| 99 | func (this *MongoDBMgr) Insert(collection string, doc interface{}) error { |
| 100 | if this.session == nil { |