data

package
v0.0.0-...-0f031a4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDocuments = errors.New("no documents in result")

Functions

func MewMongoClient

func MewMongoClient() (*mongo.Client, error)

Types

type Mapper

type Mapper interface {
	Aggregate(ctx context.Context, pipeline mongo.Pipeline, results any, opts ...*options.AggregateOptions) (any, error)
	Count(ctx context.Context, filter any, opts ...*options.CountOptions) (int64, error)
	Find(ctx context.Context, filter any, results any, opts ...*options.FindOptions) (any, error)
	FindOne(ctx context.Context, filter any, result any, opts ...*options.FindOneOptions) (any, error)
	FindOneAndUpdate(ctx context.Context, filter any, update any, result any, opts ...*options.FindOneAndUpdateOptions) (any, error)
	InsertOne(ctx context.Context, document any, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
	UpdateOne(ctx context.Context, filter any, update any, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
	GetNextSequence(ctx context.Context, name string) (*Sequence, error)
}

func NewMapper

func NewMapper(client *mongo.Client, databaseName string, collectionName string) Mapper

type Sequence

type Sequence struct {
	Seq int `bson:"seq"`
}

func (*Sequence) String

func (s *Sequence) String() string

Jump to

Keyboard shortcuts

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