Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientOpts = options.Client(). SetAuth(options.Credential{ AuthMechanism: "SCRAM-SHA-1", Username: "admin", Password: "admin", }). SetConnectTimeout(time.Second * 10). SetHosts([]string{"10.211.55.5:27017"}). SetMaxPoolSize(20). SetMinPoolSize(5). SetReadPreference(readpref.Primary()). SetReplicaSet("") // SetReplicaSet指定集群的副本集名称。(默认为空)
ClientOpts mongoClient 连接客户端参数
Functions ¶
func DeleteMany ¶
func DeleteMany()
func FindOneAndDelete ¶
func FindOneAndDelete()
func FindOneAndUpdate ¶
func FindOneAndUpdate()
func GetCollection ¶
func GetCollection()
func InsertMany ¶
func InsertMany()
func UpdateMany ¶
func UpdateMany()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.