mongo

package
v0.0.0-...-f41e87c Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disconnect

func Disconnect(client *Client)

Disconnect ...

Types

type Client

type Client struct {
	*mongo.Client
}

func Connect

func Connect(ctx context.Context) *Client

Connect ...

type Collection

type Collection struct {
	*mongo.Collection
}

func (Collection) Add

func (c Collection) Add(ctx context.Context, filters []repository.Filter, key string) (float64, error)

func (Collection) Count

func (c Collection) Count(ctx context.Context, filters []repository.Filter) (int64, error)

func (Collection) Create

func (c Collection) Create(ctx context.Context, model interface{}) (repository.Copier, error)

func (Collection) Delete

func (c Collection) Delete(ctx context.Context, id primitive.Id) (int64, error)

func (Collection) FindById

func (c Collection) FindById(ctx context.Context, id primitive.Id) (repository.Copier, error)

func (Collection) FindSingle

func (c Collection) FindSingle(ctx context.Context, filters []repository.Filter) (repository.Copier, error)

func (Collection) IncrementById

func (c Collection) IncrementById(ctx context.Context, id primitive.Id, Key string, incrementBy int) error

func (Collection) Patch

func (c Collection) Patch(ctx context.Context, id primitive.Id, patches []repository.Patch) error

func (Collection) Replace

func (c Collection) Replace(ctx context.Context, id primitive.Id, value interface{}) (repository.Copier, error)

func (Collection) Set

func (c Collection) Set(ctx context.Context, filters []repository.Filter, Key string, value interface{}) error

func (Collection) SetAll

func (c Collection) SetAll(ctx context.Context, filters []repository.Filter, keyValues []repository.KeyValue) error

func (Collection) SetAllById

func (c Collection) SetAllById(ctx context.Context, id primitive.Id, keyValues []repository.KeyValue) error

func (Collection) SetById

func (c Collection) SetById(ctx context.Context, id primitive.Id, Key string, Value interface{}) error

func (Collection) UnSet

func (c Collection) UnSet(ctx context.Context, filters []repository.Filter, Key string) error

type Copier

type Copier struct {
	// contains filtered or unexported fields
}

func (Copier) Copy

func (c Copier) Copy(destination interface{}) error

type ListCopier

type ListCopier struct {
	// contains filtered or unexported fields
}

func (ListCopier) CopyAll

func (l ListCopier) CopyAll(ctx context.Context, destination interface{}) error

Jump to

Keyboard shortcuts

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