db

package
v0.0.0-...-6794c73 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 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 DB

type DB struct {
	*mongo.Client
}

func ConnectDb

func ConnectDb(uri string) (*DB, error)

Connect to the specified mongo instance using the context for timeout

func (*DB) AddSpell

func (db *DB) AddSpell(ctx context.Context, spell []byte) error

func (*DB) DeleteSpell

func (db *DB) DeleteSpell(ctx context.Context, spell bson.M) error

func (*DB) GetMetadataNames

func (db *DB) GetMetadataNames(ctx context.Context) ([]string, error)

func (*DB) GetMetadataValues

func (db *DB) GetMetadataValues(ctx context.Context, metadataName string) ([]string, error)

func (*DB) GetSpell

func (db *DB) GetSpell(ctx context.Context, search bson.M) ([]bson.M, error)

Jump to

Keyboard shortcuts

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