database

package
v0.1.84 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 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 Base

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

func New

func New(database *mongo.Database) *Base

func (*Base) Collections

func (db *Base) Collections() collection.Map

func (*Base) Drop added in v0.1.47

func (db *Base) Drop(ctx context.Context) error

func (*Base) GetCollection

func (db *Base) GetCollection(ctx context.Context, coll_name string, conn *connection.Base, indexes ...rIndex.Inter) (*collection.Base, error)

func (*Base) ListCollectionNames added in v0.1.47

func (db *Base) ListCollectionNames(ctx context.Context, filter any) ([]string, error)

func (*Base) Name

func (db *Base) Name() string

func (*Base) NewCollection added in v0.1.47

func (db *Base) NewCollection(name string) *mongo.Collection

func (*Base) RunCommand added in v0.1.74

func (db *Base) RunCommand(ctx context.Context, command any) error

type Inter added in v0.1.47

type Inter interface {
	Name() string
	Collections() collection.Map
	GetCollection(ctx context.Context, coll_name string, conn *connection.Base, indexes ...rIndex.Inter) (*collection.Base, error)
}

type InterAdmin added in v0.1.47

type InterAdmin interface {
	Drop(ctx context.Context) error
	ListCollectionNames(ctx context.Context, filter interface{}) ([]string, error)
	NewCollection(name string) *mongo.Collection
}

type Map

type Map map[string]*Base

func (Map) Get

func (m Map) Get(db_name string) *Base

func (Map) Set

func (m Map) Set(base *Base)

Jump to

Keyboard shortcuts

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