mongodb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 4 Imported by: 0

README

MongoDB Client

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 New

func New(cfg Config) (*Client, error)

func (*Client) Database

func (c *Client) Database(opts ...*options.DatabaseOptions) *mongo.Database

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context) error

func (*Client) Ping

func (c *Client) Ping() error

type Config

type Config struct {
	URI      string `required:"true" default:"mongodb://localhost:27017"`
	Name     string `required:"true"`
	Username string `default:""`
	Password string `default:""`
}

Jump to

Keyboard shortcuts

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