mongodb

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMongoClientOnly added in v1.2.6

func NewMongoClientOnly(conf Config) (*mongo.Client, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf Config) (*Client, error)

NewClient method takes a config map argument

func (*Client) Disconnect added in v1.1.24

func (c *Client) Disconnect() error

func (*Client) GenerateID

func (c *Client) GenerateID() primitive.ObjectID

func (*Client) GetClient added in v1.1.15

func (c *Client) GetClient() *mongo.Client

func (*Client) GetDb

func (c *Client) GetDb() *mongo.Database

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) SetClient added in v1.2.6

func (c *Client) SetClient(mclient *mongo.Client)

func (*Client) SetDb added in v1.2.6

func (c *Client) SetDb(db *mongo.Database)

type Config

type Config struct {
	URI        string
	AuthSource string
	Username   string
	Password   string
	Opts       string
	Database   string
	Hosts      []string
	ReadPref   string
}

Jump to

Keyboard shortcuts

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