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" )
Click to show internal directories.
Click to hide internal directories.