|
@@ -315,6 +315,7 @@ type MongodbSim struct {
|
|
|
Password string
|
|
|
ReplSet string
|
|
|
AuthSource string
|
|
|
+ Direct bool //是否直连
|
|
|
}
|
|
|
|
|
|
func (m *MongodbSim) GetMgoConn() *MgoSess {
|
|
@@ -352,6 +353,7 @@ func (m *MongodbSim) InitPool() {
|
|
|
}
|
|
|
opts.SetAuth(cre)
|
|
|
}
|
|
|
+ opts.SetDirect(m.Direct)
|
|
|
/*ms := strings.Split(m.MongodbAddr, ",")
|
|
|
if m.ReplSet == "" && len(ms) > 1 {
|
|
|
m.ReplSet = "qfws"
|