database

package
v0.0.0-...-5be7bc9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCollection

func GetCollection[A any](db *GoodmDatabase) (*mongo.Collection, error)

func GetCollectionName

func GetCollectionName[A any]() (*string, error)

Types

type GoodmClient

type GoodmClient struct {
	*mongo.Client
	// contains filtered or unexported fields
}

func NewGoodmClient

func NewGoodmClient(client *mongo.Client) *GoodmClient

func (*GoodmClient) UseDatabase

func (odmClient *GoodmClient) UseDatabase(databaseName string, ctx *context.Context, opts ...*options.DatabaseOptions) *GoodmDatabase

type GoodmDatabase

type GoodmDatabase struct {
	*mongo.Database

	Context *context.Context
	// contains filtered or unexported fields
}

func GetGoodmDatabase

func GetGoodmDatabase() *GoodmDatabase

func NewGoodmDatabase

func NewGoodmDatabase(odmClient *GoodmClient, databaseName string, ctx *context.Context, opts ...*options.DatabaseOptions) *GoodmDatabase

func (*GoodmDatabase) GetCurrenCollection

func (odmDatabase *GoodmDatabase) GetCurrenCollection() *mongo.Collection

func (*GoodmDatabase) UseCollection

func (odmDatabase *GoodmDatabase) UseCollection(collection string) *mongo.Collection

Jump to

Keyboard shortcuts

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