Documentation
¶
Index ¶
- type Builder
- func AddToSet(field string, value any) *Builder
- func Inc(field string, value any) *Builder
- func Mul(field string, value any) *Builder
- func New() *Builder
- func PopFirst(field string) *Builder
- func PopLast(field string) *Builder
- func Pull(field string, filterBuilder *filter.Builder) *Builder
- func Push(field string, value any) *Builder
- func PushEach(field string, values ...any) *Builder
- func Rename(from, to string) *Builder
- func Set(field string, value any) *Builder
- func SetMap(fields map[string]any) *Builder
- func SetOnInsert(field string, value any) *Builder
- func SetOnInsertMap(fields map[string]any) *Builder
- func SetOnInsertStruct(document any) *Builder
- func SetStruct(document any) *Builder
- func Unset(fields ...string) *Builder
- func (b *Builder) AddToSet(field string, value any) *Builder
- func (b *Builder) And(updates ...*Builder) *Builder
- func (b *Builder) Build() bson.M
- func (b *Builder) Inc(field string, value any) *Builder
- func (b *Builder) Mul(field string, value any) *Builder
- func (b *Builder) PopFirst(field string) *Builder
- func (b *Builder) PopLast(field string) *Builder
- func (b *Builder) Pull(field string, filterBuilder *filter.Builder) *Builder
- func (b *Builder) Push(field string, value any) *Builder
- func (b *Builder) PushEach(field string, values ...any) *Builder
- func (b *Builder) Rename(from, to string) *Builder
- func (b *Builder) Set(field string, value any) *Builder
- func (b *Builder) SetMap(fields map[string]any) *Builder
- func (b *Builder) SetOnInsert(field string, value any) *Builder
- func (b *Builder) SetOnInsertMap(fields map[string]any) *Builder
- func (b *Builder) SetOnInsertStruct(document any) *Builder
- func (b *Builder) SetStruct(document any) *Builder
- func (b *Builder) ToBSONM() bson.M
- func (b *Builder) Unset(fields ...string) *Builder
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
}
Builder represents a fluent update builder for MongoDB update operations
func SetOnInsert ¶
SetOnInsert sets the value of a field only when an upsert inserts a document
func SetOnInsertMap ¶ added in v1.3.0
SetOnInsertMap sets multiple fields from a map only when an upsert inserts a document
func SetOnInsertStruct ¶ added in v1.3.0
SetOnInsertStruct sets all fields from a struct only when an upsert inserts a document
func (*Builder) AddToSet ¶
AddToSet adds a value to an array only if it doesn't already exist (method version)
func (*Builder) Pull ¶
Pull removes all instances of a value from an array that match a specified condition (method version)
func (*Builder) SetOnInsert ¶
SetOnInsert sets the value of a field only when an upsert inserts a document (method version)
func (*Builder) SetOnInsertMap ¶ added in v1.3.0
SetOnInsertMap sets multiple fields from a map only when an upsert inserts a document (method version)
func (*Builder) SetOnInsertStruct ¶ added in v1.3.0
SetOnInsertStruct sets all fields from a struct only when an upsert inserts a document (method version)
func (*Builder) SetStruct ¶ added in v1.3.0
SetStruct sets all fields from a struct (method version)