mongo

package module
v0.0.0-...-1dcaae5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[Entity any](ctx context.Context, db *mongo.Database) dbie.Repo[Entity]

Types

type Mongo

type Mongo[Entity any] struct {
	context.Context
	DB             *mongo.Database
	CollectionName string
}

func (Mongo[Entity]) Close

func (core Mongo[Entity]) Close() error

func (Mongo[Entity]) Init

func (core Mongo[Entity]) Init() error

func (Mongo[Entity]) Insert

func (core Mongo[Entity]) Insert(items ...Entity) error

func (Mongo[Entity]) InsertCtx

func (core Mongo[Entity]) InsertCtx(ctx context.Context, items ...Entity) error

func (Mongo[Entity]) SelectPage

func (core Mongo[Entity]) SelectPage(
	page dbie.Page, field string, operator dbie.Op, val any, orders ...dbie.Sort,
) (dbie.Paginated[Entity], error)

func (Mongo[Entity]) SelectPageCtx

func (core Mongo[Entity]) SelectPageCtx(
	ctx context.Context, page dbie.Page, field string, operator dbie.Op, val any, orders ...dbie.Sort,
) (items dbie.Paginated[Entity], err error)

Jump to

Keyboard shortcuts

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