model

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateGroup added in v0.0.4

type AggregateGroup bson.M

func NewAggregateGroup added in v0.0.7

func NewAggregateGroup() AggregateGroup

func (AggregateGroup) Field added in v0.0.6

func (a AggregateGroup) Field(field, from string) AggregateGroup

func (AggregateGroup) SumFixed added in v0.0.6

func (a AggregateGroup) SumFixed(field string, value int) AggregateGroup

type AggregatePage added in v0.0.4

type AggregatePage struct {
	// contains filtered or unexported fields
}

type AggregatePipeline added in v0.0.4

type AggregatePipeline mongo.Pipeline

func NewAggregatePipeline added in v0.0.5

func NewAggregatePipeline() AggregatePipeline

func (AggregatePipeline) Group added in v0.0.4

func (AggregatePipeline) Match added in v0.0.4

func (a AggregatePipeline) Match(filter Filter) AggregatePipeline

func (AggregatePipeline) Page added in v0.0.4

type FieldType added in v0.0.15

type FieldType int32

type Filter

type Filter bson.M

func NewFilter

func NewFilter() Filter

func TypedFilter

func TypedFilter(raw bson.M) Filter

func (Filter) ElementMatch added in v0.0.15

func (f Filter) ElementMatch(filter Filter) Filter

func (Filter) Eq

func (f Filter) Eq(field string, value interface{}) Filter

func (Filter) Exists added in v0.0.15

func (f Filter) Exists(field string, exists bool) Filter

func (Filter) Gt added in v0.0.15

func (f Filter) Gt(field string, value interface{}) Filter

func (Filter) Gte added in v0.0.15

func (f Filter) Gte(field string, value interface{}) Filter

func (Filter) IgnoreCaseRegex added in v0.0.4

func (f Filter) IgnoreCaseRegex(field string, pattern string)

func (Filter) In

func (f Filter) In(field string, value []interface{}) Filter

func (Filter) Lt added in v0.0.15

func (f Filter) Lt(field string, value interface{}) Filter

func (Filter) Lte added in v0.0.15

func (f Filter) Lte(field string, value interface{}) Filter

func (Filter) Ne added in v0.0.15

func (f Filter) Ne(field string, value interface{}) Filter

func (Filter) Nin

func (f Filter) Nin(field string, value []interface{}) Filter

func (Filter) Not added in v0.0.15

func (f Filter) Not(field string, filter Filter) Filter

func (Filter) Or

func (f Filter) Or(conditions ...Filter) Filter

func (Filter) Regex added in v0.0.4

func (f Filter) Regex(field string, pattern string)

func (Filter) Type added in v0.0.15

func (f Filter) Type(field string, fieldType FieldType) Filter

type FindOneAndUpdate

type FindOneAndUpdate UpdateSome

func NewFindOneAndUpdate added in v0.0.4

func NewFindOneAndUpdate() *FindOneAndUpdate

func (*FindOneAndUpdate) SetFilter added in v0.0.4

func (m *FindOneAndUpdate) SetFilter(filter Filter) *FindOneAndUpdate

func (*FindOneAndUpdate) SetUpdate added in v0.0.4

func (m *FindOneAndUpdate) SetUpdate(update Update) *FindOneAndUpdate

type TypedUpdateOneModel added in v0.0.10

type TypedUpdateOneModel struct {
	// contains filtered or unexported fields
}

func NewTypeUpdateOneModel added in v0.0.10

func NewTypeUpdateOneModel() *TypedUpdateOneModel

func (*TypedUpdateOneModel) ArrayFilters added in v0.0.11

func (uom *TypedUpdateOneModel) ArrayFilters(filters options.ArrayFilters) *TypedUpdateOneModel

ArrayFilters specifies a set of filters to determine which elements should be modified when updating an array field.

func (*TypedUpdateOneModel) Collation added in v0.0.11

func (uom *TypedUpdateOneModel) Collation(collation *options.Collation) *TypedUpdateOneModel

Collation specifies a collation to use for string comparisons. The default is nil, meaning no collation will be used.

func (*TypedUpdateOneModel) Filter added in v0.0.11

func (uom *TypedUpdateOneModel) Filter(filter Filter) *TypedUpdateOneModel

Filter specifies a filter to use to select the document to update. The filter must be a document containing query operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching documents.

func (*TypedUpdateOneModel) Hint added in v0.0.11

func (uom *TypedUpdateOneModel) Hint(hint interface{}) *TypedUpdateOneModel

Hint specifies the index to use for the operation. This should either be the index name as a string or the index specification as a document. This option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if this option is specified. The driver will return an error if this option is specified during an unacknowledged write operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which means that no hint will be sent.

func (*TypedUpdateOneModel) Update added in v0.0.11

func (uom *TypedUpdateOneModel) Update(update Update) *TypedUpdateOneModel

Update specifies the modifications to be made to the selected document. The value must be a document containing update operators (https://docs.mongodb.com/manual/reference/operator/update/). It cannot be nil or empty.

func (*TypedUpdateOneModel) Upsert added in v0.0.11

func (uom *TypedUpdateOneModel) Upsert(upsert bool) *TypedUpdateOneModel

Upsert specifies whether or not a new document should be inserted if no document matching the filter is found. If an upsert is performed, the _id of the upserted document can be retrieved from the UpsertedIDs field of the BulkWriteResult.

func (*TypedUpdateOneModel) WriteModel added in v0.0.10

func (uom *TypedUpdateOneModel) WriteModel() mongo.WriteModel

type Update

type Update bson.M

func NewUpdate added in v0.0.13

func NewUpdate() Update

func (Update) AddEachToSet added in v0.0.15

func (u Update) AddEachToSet(field string, elements []interface{}) Update

func (Update) AddToSet added in v0.0.15

func (u Update) AddToSet(field string, value interface{}) Update

func (Update) PopFirst added in v0.0.15

func (u Update) PopFirst(field string) Update

func (Update) PopLast added in v0.0.15

func (u Update) PopLast(field string) Update

func (Update) Pull added in v0.0.15

func (u Update) Pull(filter Filter) Update

func (Update) Set

func (u Update) Set(update bson.M) Update

func (Update) SetOnInsert

func (u Update) SetOnInsert(update bson.M) Update

type UpdateById

type UpdateById struct {
	Id     primitive.ObjectID
	Update Update
}

type UpdateMany

type UpdateMany UpdateSome

func NewUpdateMany added in v0.0.9

func NewUpdateMany() *UpdateMany

func (*UpdateMany) SetFilter added in v0.0.9

func (m *UpdateMany) SetFilter(filter Filter) *UpdateMany

func (*UpdateMany) SetUpdate added in v0.0.9

func (m *UpdateMany) SetUpdate(update Update) *UpdateMany

type UpdateOne added in v0.0.15

type UpdateOne UpdateSome

type UpdateSome added in v0.0.15

type UpdateSome struct {
	Filter Filter
	Update Update
}

Jump to

Keyboard shortcuts

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