Documentation ¶
Index ¶
- type AfterOpContext
- type AfterOpContextOption
- type BeforeOpContext
- type BeforeOpContextOption
- type CondContext
- type CondContextOption
- type Updater
- func (u *Updater[T]) Filter(filter any) *Updater[T]
- func (u *Updater[T]) RegisterAfterHooks(hooks ...afterHookFn) *Updater[T]
- func (u *Updater[T]) RegisterBeforeHooks(hooks ...beforeHookFn) *Updater[T]
- func (u *Updater[T]) Replacement(replacement any) *Updater[T]
- func (u *Updater[T]) UpdateMany(ctx context.Context, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
- func (u *Updater[T]) UpdateOne(ctx context.Context, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
- func (u *Updater[T]) Updates(updates any) *Updater[T]
- func (u *Updater[T]) UpdatesWithOperator(operator string, value any) *Updater[T]
- func (u *Updater[T]) Upsert(ctx context.Context, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AfterOpContext ¶ added in v0.12.0
type AfterOpContext struct { Col *mongo.Collection `opt:"-"` *CondContext `opt:"-"` }
func NewAfterOpContext ¶ added in v0.12.0
func NewAfterOpContext(col *mongo.Collection, condContext *CondContext, opts ...AfterOpContextOption) *AfterOpContext
type AfterOpContextOption ¶ added in v0.12.0
type AfterOpContextOption func(*AfterOpContext)
type BeforeOpContext ¶ added in v0.12.0
type BeforeOpContext struct { Col *mongo.Collection `opt:"-"` *CondContext `opt:"-"` }
func NewBeforeOpContext ¶ added in v0.12.0
func NewBeforeOpContext(col *mongo.Collection, condContext *CondContext, opts ...BeforeOpContextOption) *BeforeOpContext
type BeforeOpContextOption ¶ added in v0.12.0
type BeforeOpContextOption func(*BeforeOpContext)
type CondContext ¶ added in v0.12.0
func NewCondContext ¶ added in v0.12.0
func NewCondContext(filter any, opts ...CondContextOption) *CondContext
type CondContextOption ¶ added in v0.12.0
type CondContextOption func(*CondContext)
func WithReplacement ¶ added in v0.12.0
func WithReplacement(replacement any) CondContextOption
func WithUpdates ¶ added in v0.12.0
func WithUpdates(updates any) CondContextOption
type Updater ¶
type Updater[T any] struct { // contains filtered or unexported fields }
func NewUpdater ¶
func NewUpdater[T any](collection *mongo.Collection) *Updater[T]
func (*Updater[T]) RegisterAfterHooks ¶ added in v0.12.0
func (*Updater[T]) RegisterBeforeHooks ¶ added in v0.12.0
func (*Updater[T]) Replacement ¶ added in v0.11.0
func (*Updater[T]) UpdateMany ¶
func (u *Updater[T]) UpdateMany(ctx context.Context, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*Updater[T]) UpdateOne ¶
func (u *Updater[T]) UpdateOne(ctx context.Context, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*Updater[T]) UpdatesWithOperator ¶ added in v0.0.4
func (*Updater[T]) Upsert ¶ added in v0.11.0
func (u *Updater[T]) Upsert(ctx context.Context, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
Click to show internal directories.
Click to hide internal directories.