mongodb

package module
v0.0.0-...-492d743 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: BSD-3-Clause-Clear Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const MID = "_id"

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, filenames ...string) *mongo.Client

func Disconnect

func Disconnect(client *mongo.Client, ctx context.Context)

func NewMongoDataAccess

func NewMongoDataAccess[E MongoEntity](tm TransactionManager) TxDataAccess[E]

func NewMongoTransactionManager

func NewMongoTransactionManager(client *mongo.Client) TransactionManager

func PInt64

func PInt64(i int) *int64

func ResolveId

func ResolveId(id any) (ObjectID, error)

Types

type IdSetter

type IdSetter interface {
	// contains filtered or unexported methods
}

type MongoEntity

type MongoEntity interface {
	Entity
	Database() string
	Collection() string
}

type MongoId

type MongoId struct {
	Id *primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
}

func NewMongoId

func NewMongoId(Id *primitive.ObjectID) MongoId

func (MongoId) GetId

func (e MongoId) GetId() any

func (MongoId) SetId

func (e MongoId) SetId(self any, id any) error

type QueryBuilder

type QueryBuilder interface {
	BuildFilter() A
}

Jump to

Keyboard shortcuts

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