mongdbdemo

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 9 Imported by: 0

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 Count

func Count()

func DeleteMany

func DeleteMany()

func DeleteOne

func DeleteOne()

func Distinct

func Distinct()

func Find

func Find()

func FindOne

func FindOne()

func FindOneAndDelete

func FindOneAndDelete()

func FindOneAndUpdate

func FindOneAndUpdate()

func GetClient

func GetClient()

func GetCollection

func GetCollection()

func InsertMany

func InsertMany()

func InsertOne

func InsertOne()

func UpdateMany

func UpdateMany()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL