mongodb

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

type Config

type Config struct {
	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