mongodb

package
v0.12.8 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedCreatingDBClient = errors.New("failed creating a DB client")
	ErrFailedConnecting       = errors.New("failed connecting to the DB")
)

Functions

func IsUniqueIndexViolation added in v0.5.1

func IsUniqueIndexViolation(err error) bool

Types

type Access

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

func NewDBAccess

func NewDBAccess(uri, database string) (*Access, error)

NewDBAccess creates a new DBAccess, connect to the database

func (*Access) Collection

func (a *Access) Collection(name string) *mongo.Collection

func (*Access) CreateIndexes

func (a *Access) CreateIndexes(ctx context.Context, coll string, models []mongo.IndexModel) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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