operation

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpContext

type OpContext struct {
	Col *mongo.Collection `opt:"-"`
	Doc any
	// filter also can be used as query
	Filter      any
	Updates     any
	Replacement any
}

func NewOpContext

func NewOpContext(col *mongo.Collection, opts ...OpContextOption) *OpContext

type OpContextOption

type OpContextOption func(*OpContext)

func WithDoc

func WithDoc(doc any) OpContextOption

func WithFilter

func WithFilter(filter any) OpContextOption

func WithReplacement

func WithReplacement(replacement any) OpContextOption

func WithUpdate

func WithUpdate(update any) OpContextOption

type OpType

type OpType string
const (
	OpTypeBeforeInsert OpType = "beforeInsert"
	OpTypeAfterInsert  OpType = "afterInsert"
	OpTypeBeforeUpdate OpType = "beforeUpdate"
	OpTypeAfterUpdate  OpType = "afterUpdate"
	OpTypeBeforeDelete OpType = "beforeDelete"
	OpTypeAfterDelete  OpType = "afterDelete"
	OpTypeBeforeUpsert OpType = "beforeUpsert"
	OpTypeAfterUpsert  OpType = "afterUpsert"
	OpTypeBeforeFind   OpType = "beforeFind"
	OpTypeAfterFind    OpType = "afterFind"
)

Jump to

Keyboard shortcuts

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