bulks

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkModel

type BulkModel interface {
	WriteModel() mongo.WriteModel
}

type DeleteManyModel

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

func NewDeleteManyModel

func NewDeleteManyModel() *DeleteManyModel

func (*DeleteManyModel) SetCollation

func (dom *DeleteManyModel) SetCollation(collation *options.Collation) *DeleteManyModel

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

func (*DeleteManyModel) SetFilter

func (dom *DeleteManyModel) SetFilter(filter filters.Filter) *DeleteManyModel

SetFilter specifies a filter to use to select the document to delete. 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 (*DeleteManyModel) SetHint

func (dom *DeleteManyModel) SetHint(hint interface{}) *DeleteManyModel

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.4. 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 (*DeleteManyModel) WriteModel

func (dom *DeleteManyModel) WriteModel() mongo.WriteModel

type DeleteOneModel

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

func NewDeleteOneModel

func NewDeleteOneModel() *DeleteOneModel

func (*DeleteOneModel) SetCollation

func (dom *DeleteOneModel) SetCollation(collation *options.Collation) *DeleteOneModel

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

func (*DeleteOneModel) SetFilter

func (dom *DeleteOneModel) SetFilter(filter filters.Filter) *DeleteOneModel

SetFilter specifies a filter to use to select the document to delete. 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 (*DeleteOneModel) SetHint

func (dom *DeleteOneModel) SetHint(hint interface{}) *DeleteOneModel

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.4. 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 (*DeleteOneModel) WriteModel

func (dom *DeleteOneModel) WriteModel() mongo.WriteModel

type InsertOneModel

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

func NewInsertOneModel

func NewInsertOneModel() *InsertOneModel

func (*InsertOneModel) SetDocument

func (iom *InsertOneModel) SetDocument(doc any) *InsertOneModel

SetDocument specifies the document to be inserted. The document cannot be nil. If it does not have an _id field when transformed into BSON, one will be added automatically to the marshalled document. The original document will not be modified.

func (*InsertOneModel) WriteModel

func (iom *InsertOneModel) WriteModel() mongo.WriteModel

type ReplaceOneModel

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

func NewReplaceOneModel

func NewReplaceOneModel() *ReplaceOneModel

func (*ReplaceOneModel) SetCollation

func (rom *ReplaceOneModel) SetCollation(collation *options.Collation) *ReplaceOneModel

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

func (*ReplaceOneModel) SetFilter

func (rom *ReplaceOneModel) SetFilter(filter filters.Filter) *ReplaceOneModel

SetFilter specifies a filter to use to select the document to replace. 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 (*ReplaceOneModel) SetHint

func (rom *ReplaceOneModel) SetHint(hint interface{}) *ReplaceOneModel

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 (*ReplaceOneModel) SetReplacement

func (rom *ReplaceOneModel) SetReplacement(rep interface{}) *ReplaceOneModel

SetReplacement specifies a document that will be used to replace the selected document. It cannot be nil and cannot contain any update operators (https://www.mongodb.com/docs/manual/reference/operator/update/).

func (*ReplaceOneModel) SetUpsert

func (rom *ReplaceOneModel) SetUpsert(upsert bool) *ReplaceOneModel

SetUpsert specifies whether or not the replacement 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 (*ReplaceOneModel) WriteModel

func (rom *ReplaceOneModel) WriteModel() mongo.WriteModel

type UpdateManyModel

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

func NewUpdateManyModel

func NewUpdateManyModel() *UpdateManyModel

func (*UpdateManyModel) SetArrayFilters

func (umm *UpdateManyModel) SetArrayFilters(filters options.ArrayFilters) *UpdateManyModel

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

func (*UpdateManyModel) SetCollation

func (umm *UpdateManyModel) SetCollation(collation *options.Collation) *UpdateManyModel

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

func (*UpdateManyModel) SetFilter

func (umm *UpdateManyModel) SetFilter(filter filters.Filter) *UpdateManyModel

SetFilter specifies a filter to use to select documents to update. The filter must be a document containing query operators. It cannot be nil.

func (*UpdateManyModel) SetHint

func (umm *UpdateManyModel) SetHint(hint interface{}) *UpdateManyModel

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 (*UpdateManyModel) SetUpdate

func (umm *UpdateManyModel) SetUpdate(update updates.Update) *UpdateManyModel

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

func (*UpdateManyModel) SetUpsert

func (umm *UpdateManyModel) SetUpsert(upsert bool) *UpdateManyModel

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 (*UpdateManyModel) WriteModel

func (umm *UpdateManyModel) WriteModel() mongo.WriteModel

type UpdateOneModel

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

func NewUpdateOneModel

func NewUpdateOneModel() *UpdateOneModel

func (*UpdateOneModel) SetArrayFilters

func (uom *UpdateOneModel) SetArrayFilters(filters options.ArrayFilters) *UpdateOneModel

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

func (*UpdateOneModel) SetCollation

func (uom *UpdateOneModel) SetCollation(collation *options.Collation) *UpdateOneModel

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

func (*UpdateOneModel) SetFilter

func (uom *UpdateOneModel) SetFilter(filter filters.Filter) *UpdateOneModel

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 (*UpdateOneModel) SetHint

func (uom *UpdateOneModel) SetHint(hint interface{}) *UpdateOneModel

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 (*UpdateOneModel) SetUpdate

func (uom *UpdateOneModel) SetUpdate(update updates.Update) *UpdateOneModel

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

func (*UpdateOneModel) SetUpsert

func (uom *UpdateOneModel) SetUpsert(upsert bool) *UpdateOneModel

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 (*UpdateOneModel) WriteModel

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

Jump to

Keyboard shortcuts

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