Documentation ¶
Index ¶
- type AggregateGroup
- type AggregatePage
- type AggregatePipeline
- type Filter
- func (f Filter) Eq(field string, value interface{}) Filter
- func (f Filter) IgnoreCaseRegex(field string, pattern string)
- func (f Filter) In(field string, value []interface{}) Filter
- func (f Filter) Nin(field string, value []interface{}) Filter
- func (f Filter) Or(conditions bson.A) Filter
- func (f Filter) Regex(field string, pattern string)
- type FindOneAndUpdate
- type TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetArrayFilters(filters options.ArrayFilters) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetCollation(collation *options.Collation) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetFilter(filter Filter) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetHint(hint interface{}) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetUpdate(update Update) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) SetUpsert(upsert bool) *TypedUpdateOneModel
- func (uom *TypedUpdateOneModel) WriteModel() mongo.WriteModel
- type Update
- type UpdateById
- type UpdateMany
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateGroup ¶ added in v0.0.4
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
func NewAggregatePipeline ¶ added in v0.0.5
func NewAggregatePipeline() AggregatePipeline
func (AggregatePipeline) Group ¶ added in v0.0.4
func (a AggregatePipeline) Group(group AggregateGroup) AggregatePipeline
func (AggregatePipeline) Match ¶ added in v0.0.4
func (a AggregatePipeline) Match(filter Filter) AggregatePipeline
func (AggregatePipeline) Page ¶ added in v0.0.4
func (a AggregatePipeline) Page(page AggregatePage) AggregatePipeline
type FindOneAndUpdate ¶
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) SetArrayFilters ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetArrayFilters(filters options.ArrayFilters) *TypedUpdateOneModel
SetArrayFilters specifies a set of filters to determine which elements should be modified when updating an array field.
func (*TypedUpdateOneModel) SetCollation ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetCollation(collation *options.Collation) *TypedUpdateOneModel
SetCollation specifies a collation to use for string comparisons. The default is nil, meaning no collation will be used.
func (*TypedUpdateOneModel) SetFilter ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetFilter(filter Filter) *TypedUpdateOneModel
SetFilter 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) SetHint ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetHint(hint interface{}) *TypedUpdateOneModel
SetHint 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) SetUpdate ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetUpdate(update Update) *TypedUpdateOneModel
SetUpdate 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) SetUpsert ¶ added in v0.0.10
func (uom *TypedUpdateOneModel) SetUpsert(upsert bool) *TypedUpdateOneModel
SetUpsert 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 UpdateById ¶
type UpdateMany ¶
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