mongodb

package
v0.0.0-...-c4ca307 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	*mongo.Collection
}

func (Collection) FindAll

func (c Collection) FindAll(ctx context.Context, filter, results any, opts ...*options.FindOptions) (err error)

func (Collection) SetupIndexes

func (c Collection) SetupIndexes(models []mongo.IndexModel) (err error)

type Database

type Database struct {
	*mongo.Database
}

func Connect

func Connect(ctx context.Context, opts *options.ClientOptions, dbName string) (db *Database, err error)

func (Database) Collection

func (db Database) Collection(name string, opts ...*options.CollectionOptions) *Collection

func (*Database) DoTx

func (db *Database) DoTx(ctx context.Context, fn func(ctx mongo.SessionContext) error) error

func (*Database) DoTxWithOptions

func (db *Database) DoTxWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(ctx mongo.SessionContext) error) error

func (Database) SetupSchemas

func (db Database) SetupSchemas(ctx context.Context, fs fs.FS, collectionNames []string) error

Jump to

Keyboard shortcuts

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