operation

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 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
	MongoOptions any
	ModelHook    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 WithModelHook added in v1.4.0

func WithModelHook(modelHook any) OpContextOption

func WithMongoOptions added in v1.3.0

func WithMongoOptions(mongoOptions any) OpContextOption

func WithReplacement

func WithReplacement(replacement any) OpContextOption

func WithUpdates added in v1.3.0

func WithUpdates(updates 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