typed_mongo

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 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 TypedCollection added in v0.0.3

type TypedCollection[D any] interface {
	FindOne(ctx context.Context, filter model.Filter, opts ...*options.FindOneOptions) (*D, error)
	Find(ctx context.Context, filter model.Filter, opts ...*options.FindOptions) ([]*D, error)
	FindByDocIds(ctx context.Context, ids []primitive.ObjectID, opts ...*options.FindOptions) ([]*D, error)
	InsertOne(ctx context.Context, doc D) (primitive.ObjectID, error)
	InsertMany(ctx context.Context, docs []*D) ([]primitive.ObjectID, error)
	FindOneAndUpdate(ctx context.Context, m *model.FindOneAndUpdate, opts ...*options.FindOneAndUpdateOptions) (*D, error)
	UpdateMany(ctx context.Context, m *model.UpdateMany, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
	UpdateById(ctx context.Context, m *model.UpdateById, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
}

func NewTypedCollection added in v0.0.3

func NewTypedCollection[D any](db *mongo.Database, name string, opts ...*options.CollectionOptions) TypedCollection[D]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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