Help us shape the future of Go! Take the 2026 Go Developer Survey

mongodb

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI      string
	Database string
	Enabled  bool
}

Config MongoDB 连接配置

type Conn

type Conn struct {
	Client *mongo.Client
	DB     *mongo.Database
}

func MustNewConn added in v1.7.3

func MustNewConn(cfg Config) *Conn

MustNewConn 创建 MongoDB 连接,如果失败则 panic。

func NewConn

func NewConn(cfg Config) (*Conn, error)

Jump to

Keyboard shortcuts

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