relations

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func New

func New(mongo *mongodata.MongoDB, collection string) *Builder

Метод создает структуру для управления отношениями между документами в 2 коллекциях

func (*Builder) Count

func (b *Builder) Count(ctx context.Context, docID primitive.ObjectID, inCollection string, forKey string, value bool) error

func (*Builder) Make

func (b *Builder) Make(ctx context.Context, docID primitive.ObjectID, inCollection string, forKey string, byId primitive.ObjectID, value bool) error

func (*Builder) MakeAndCount

func (b *Builder) MakeAndCount(ctx context.Context, docID primitive.ObjectID, inCollection string, forKey string, byId primitive.ObjectID, value bool) error

func (*Builder) SetCounter

func (b *Builder) SetCounter(ctx context.Context, docID primitive.ObjectID, inCollection string, forKey string, value int) error

type Counters

type Counters map[string]int

func (Counters) Count

func (c Counters) Count(key string) int

type Relations

type Relations map[string][]primitive.ObjectID

func (Relations) Active

func (r Relations) Active(key string, forID primitive.ObjectID) bool

func (Relations) List

func (r Relations) List(key string) []primitive.ObjectID

Jump to

Keyboard shortcuts

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