Documentation ¶
Index ¶
- type AggregateExecutor
- func (a *AggregateExecutor[D, I]) AllowDiskUse() *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) BatchSize(i int32) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) BypassDocumentValidation() *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) Collation(c *options.Collation) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) Comment(s string) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) Custom(c rawbson.M) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) ExecuteTo(ctx context.Context, result interface{}) error
- func (a *AggregateExecutor[D, I]) Hint(index string) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) Let(let rawbson.M) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) MaxAwaitTime(d time.Duration) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) MaxTime(d time.Duration) *AggregateExecutor[D, I]
- func (a *AggregateExecutor[D, I]) Primary() *AggregateExecutor[D, I]
- type BulkWriteExecutor
- func (b *BulkWriteExecutor[D, I]) BypassDocumentValidation() *BulkWriteExecutor[D, I]
- func (b *BulkWriteExecutor[D, I]) Comment(comment string) *BulkWriteExecutor[D, I]
- func (b *BulkWriteExecutor[D, I]) Execute(ctx context.Context) (*model.BulkWriteResult[I], error)
- func (b *BulkWriteExecutor[D, I]) Let(let rawbson.M) *BulkWriteExecutor[D, I]
- func (b *BulkWriteExecutor[D, I]) Ordered() *BulkWriteExecutor[D, I]
- func (b *BulkWriteExecutor[D, I]) UpdateMany(update *update.TypedUpdateManyModel) *BulkWriteExecutor[D, I]
- func (b *BulkWriteExecutor[D, I]) UpdateOne(update *update.TypedUpdateOneModel) *BulkWriteExecutor[D, I]
- type CountExecutor
- func (c *CountExecutor[D, I]) Collation(collation *options.Collation) *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) Comment(comment string) *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) Estimated(ctx context.Context) (int64, error)
- func (c *CountExecutor[D, I]) Execute(ctx context.Context) (int64, error)
- func (c *CountExecutor[D, I]) Hint(index string) *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) Limit(i int64) *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) MaxTime(d time.Duration) *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) Primary() *CountExecutor[D, I]
- func (c *CountExecutor[D, I]) Skip(i int64) *CountExecutor[D, I]
- type DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) AllowDiskUse() *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) BatchSize(i int32) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) BypassDocumentValidation() *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) Collation(c *options.Collation) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) Comment(s string) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) Custom(c rawbson.M) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) ExecuteTo(ctx context.Context, result interface{}) error
- func (a *DatabaseAggregateExecutor) Hint(index string) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) Let(let rawbson.M) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) MaxAwaitTime(d time.Duration) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) MaxTime(d time.Duration) *DatabaseAggregateExecutor
- func (a *DatabaseAggregateExecutor) Primary() *DatabaseAggregateExecutor
- type DeleteExecutor
- func (d *DeleteExecutor[D, I]) Collation(c *options.Collation) *DeleteExecutor[D, I]
- func (d *DeleteExecutor[D, I]) Comment(comment string) *DeleteExecutor[D, I]
- func (d *DeleteExecutor[D, I]) Execute(ctx context.Context) (int64, error)
- func (d *DeleteExecutor[D, I]) Hint(index string) *DeleteExecutor[D, I]
- func (d *DeleteExecutor[D, I]) Let(let rawbson.M) *DeleteExecutor[D, I]
- type DistinctExecutor
- func (do *DistinctExecutor) Collation(c *options.Collation) *DistinctExecutor
- func (do *DistinctExecutor) Comment(comment string) *DistinctExecutor
- func (do *DistinctExecutor) Execute(ctx context.Context) ([]any, error)
- func (do *DistinctExecutor) MaxTime(d time.Duration) *DistinctExecutor
- func (do *DistinctExecutor) Primary() *DistinctExecutor
- type FindExecutor
- func (f *FindExecutor[D, I]) AllowDiskUse() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) AllowPartialResults() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) BatchSize(i int32) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Collation(collation *options.Collation) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Collect(ctx context.Context, data any) error
- func (f *FindExecutor[D, I]) Comment(comment string) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Cursor(ctx context.Context) (*FindIterator[D, I], error)
- func (f *FindExecutor[D, I]) CursorType(ct options.CursorType) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Hint(index string) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Let(let rawbson.M) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Limit(limit int64) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Max(max int) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) MaxAwaitTime(d time.Duration) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) MaxTime(d time.Duration) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Min(min int) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) NoCursorTimeout() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) OplogReplay() *FindExecutor[D, I]deprecated
- func (f *FindExecutor[D, I]) Primary() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Projection(projection *projections.Options) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) ReturnKey() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) ShowRecordID() *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Skip(skip int64) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) Snapshot() *FindExecutor[D, I]deprecated
- func (f *FindExecutor[D, I]) Sort(sort *sorts.Options) *FindExecutor[D, I]
- func (f *FindExecutor[D, I]) ToArray(ctx context.Context) ([]D, error)
- type FindIterator
- type FindOneAndUpdateExecutor
- func (f *FindOneAndUpdateExecutor[D, I]) ArrayFilters(af options.ArrayFilters) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) BypassDocumentValidation() *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Collation(collation *options.Collation) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Comment(comment interface{}) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Execute(ctx context.Context) (D, error)
- func (f *FindOneAndUpdateExecutor[D, I]) Hint(index string) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Let(l rawbson.M) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) MaxTime(d time.Duration) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Projection(projection *projections.Options) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) ReturnAfter() *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) ReturnBefore() *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Sort(sort *sorts.Options) *FindOneAndUpdateExecutor[D, I]
- func (f *FindOneAndUpdateExecutor[D, I]) Upsert() *FindOneAndUpdateExecutor[D, I]
- type FindOneExecutor
- func (f *FindOneExecutor[D, I]) AllowPartialResults() *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Collation(collation *options.Collation) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Comment(comment string) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Execute(ctx context.Context) (D, error)
- func (f *FindOneExecutor[D, I]) ExecuteTo(ctx context.Context, data any) error
- func (f *FindOneExecutor[D, I]) Hint(index string) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Max(max int) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) MaxAwaitTime(d time.Duration) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) MaxTime(d time.Duration) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Min(min int) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) OplogReplay() *FindOneExecutor[D, I]deprecated
- func (f *FindOneExecutor[D, I]) Primary() *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) ReturnKey() *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) ShowRecordID() *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Skip(skip int64) *FindOneExecutor[D, I]
- func (f *FindOneExecutor[D, I]) Snapshot() *FindOneExecutor[D, I]deprecated
- func (f *FindOneExecutor[D, I]) Sort(sort *sorts.Options) *FindOneExecutor[D, I]
- type InsertManyExecutor
- func (i *InsertManyExecutor[D, I]) Add(docs ...D) *InsertManyExecutor[D, I]
- func (i *InsertManyExecutor[D, I]) BypassDocumentValidation() *InsertManyExecutor[D, I]
- func (i *InsertManyExecutor[D, I]) Comment(comment string) *InsertManyExecutor[D, I]
- func (i *InsertManyExecutor[D, I]) Execute(ctx context.Context) ([]I, error)
- func (i *InsertManyExecutor[D, I]) SetOrdered() *InsertManyExecutor[D, I]
- type InsertOneExecutor
- type UpdateExecutor
- func NewUpdateByIdExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, id I, update *update.Update) *UpdateExecutor[D, I]
- func NewUpdateManyExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, filter *filters.Filter, update *update.Update) *UpdateExecutor[D, I]
- func NewUpdateOneExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, filter *filters.Filter, update *update.Update) *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) ArrayFilters(af options.ArrayFilters) *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) BypassDocumentValidation() *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) Collation(c *options.Collation) *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) Execute(ctx context.Context) (*model.UpdateResult[I], error)
- func (u *UpdateExecutor[D, I]) Hint(index string) *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) Let(l rawbson.M) *UpdateExecutor[D, I]
- func (u *UpdateExecutor[D, I]) Upsert() *UpdateExecutor[D, I]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateExecutor ¶
type AggregateExecutor[D bson.Doc[I], I bson.ID] struct { // contains filtered or unexported fields }
func NewAggregateExecutor ¶
func NewAggregateExecutor[D bson.Doc[I], I bson.ID]( readprefPrimary, readprefDefault *raw.Collection, pipe aggregate.Pipeline, ) *AggregateExecutor[D, I]
func (*AggregateExecutor[D, I]) AllowDiskUse ¶
func (a *AggregateExecutor[D, I]) AllowDiskUse() *AggregateExecutor[D, I]
AllowDiskUse sets the value for the AllowDiskUse field.
func (*AggregateExecutor[D, I]) BatchSize ¶
func (a *AggregateExecutor[D, I]) BatchSize(i int32) *AggregateExecutor[D, I]
BatchSize sets the value for the BatchSize field.
func (*AggregateExecutor[D, I]) BypassDocumentValidation ¶
func (a *AggregateExecutor[D, I]) BypassDocumentValidation() *AggregateExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*AggregateExecutor[D, I]) Collation ¶
func (a *AggregateExecutor[D, I]) Collation(c *options.Collation) *AggregateExecutor[D, I]
Collation sets the value for the Collation field.
func (*AggregateExecutor[D, I]) Comment ¶
func (a *AggregateExecutor[D, I]) Comment(s string) *AggregateExecutor[D, I]
Comment sets the value for the Comment field.
func (*AggregateExecutor[D, I]) Custom ¶
func (a *AggregateExecutor[D, I]) Custom(c rawbson.M) *AggregateExecutor[D, I]
Custom sets the value for the Custom field. Key-value pairs of the BSON map should correlate with desired option names and values. Values must be Marshalable. Custom options may conflict with non-custom options, and custom options bypass client-side validation. Prefer using non-custom options where possible.
func (*AggregateExecutor[D, I]) ExecuteTo ¶
func (a *AggregateExecutor[D, I]) ExecuteTo(ctx context.Context, result interface{}) error
func (*AggregateExecutor[D, I]) Hint ¶
func (a *AggregateExecutor[D, I]) Hint(index string) *AggregateExecutor[D, I]
Hint sets the value for the Hint field.
func (*AggregateExecutor[D, I]) Let ¶
func (a *AggregateExecutor[D, I]) Let(let rawbson.M) *AggregateExecutor[D, I]
Let sets the value for the Let field.
func (*AggregateExecutor[D, I]) MaxAwaitTime ¶
func (a *AggregateExecutor[D, I]) MaxAwaitTime(d time.Duration) *AggregateExecutor[D, I]
MaxAwaitTime sets the value for the MaxAwaitTime field.
func (*AggregateExecutor[D, I]) MaxTime ¶
func (a *AggregateExecutor[D, I]) MaxTime(d time.Duration) *AggregateExecutor[D, I]
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
func (*AggregateExecutor[D, I]) Primary ¶
func (a *AggregateExecutor[D, I]) Primary() *AggregateExecutor[D, I]
type BulkWriteExecutor ¶
type BulkWriteExecutor[D bson.Doc[I], I bson.ID] struct { // contains filtered or unexported fields }
func NewBulkWriteExecutor ¶
func NewBulkWriteExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection) *BulkWriteExecutor[D, I]
func (*BulkWriteExecutor[D, I]) BypassDocumentValidation ¶
func (b *BulkWriteExecutor[D, I]) BypassDocumentValidation() *BulkWriteExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*BulkWriteExecutor[D, I]) Comment ¶
func (b *BulkWriteExecutor[D, I]) Comment(comment string) *BulkWriteExecutor[D, I]
Comment sets the value for the Comment field.
func (*BulkWriteExecutor[D, I]) Execute ¶
func (b *BulkWriteExecutor[D, I]) Execute(ctx context.Context) (*model.BulkWriteResult[I], error)
func (*BulkWriteExecutor[D, I]) Let ¶
func (b *BulkWriteExecutor[D, I]) Let(let rawbson.M) *BulkWriteExecutor[D, I]
Let sets the value for the Let field. Let specifies parameters for all update and delete commands in the BulkWrite. This option is only valid for MongoDB versions >= 5.0. Older servers will report an error for using this option. This must be a document mapping parameter names to values. Values must be constant or closed expressions that do not reference document fields. Parameters can then be accessed as variables in an aggregate expression context (e.g. "$$var").
func (*BulkWriteExecutor[D, I]) Ordered ¶
func (b *BulkWriteExecutor[D, I]) Ordered() *BulkWriteExecutor[D, I]
Ordered sets the value for the Ordered field.
func (*BulkWriteExecutor[D, I]) UpdateMany ¶
func (b *BulkWriteExecutor[D, I]) UpdateMany(update *update.TypedUpdateManyModel) *BulkWriteExecutor[D, I]
func (*BulkWriteExecutor[D, I]) UpdateOne ¶
func (b *BulkWriteExecutor[D, I]) UpdateOne(update *update.TypedUpdateOneModel) *BulkWriteExecutor[D, I]
type CountExecutor ¶
func NewCountExecutor ¶
func NewCountExecutor[D bson.Doc[I], I bson.ID]( readprefPrimary, readprefDefault *raw.Collection, filter *filters.Filter, ) *CountExecutor[D, I]
func (*CountExecutor[D, I]) Collation ¶
func (c *CountExecutor[D, I]) Collation(collation *options.Collation) *CountExecutor[D, I]
Collation sets the value for the Collation field.
func (*CountExecutor[D, I]) Comment ¶
func (c *CountExecutor[D, I]) Comment(comment string) *CountExecutor[D, I]
Comment sets the value for the Comment field.
func (*CountExecutor[D, I]) Estimated ¶
func (c *CountExecutor[D, I]) Estimated(ctx context.Context) (int64, error)
func (*CountExecutor[D, I]) Execute ¶
func (c *CountExecutor[D, I]) Execute(ctx context.Context) (int64, error)
func (*CountExecutor[D, I]) Hint ¶
func (c *CountExecutor[D, I]) Hint(index string) *CountExecutor[D, I]
Hint sets the value for the Hint field.
func (*CountExecutor[D, I]) Limit ¶
func (c *CountExecutor[D, I]) Limit(i int64) *CountExecutor[D, I]
Limit sets the value for the Limit field.
func (*CountExecutor[D, I]) MaxTime ¶
func (c *CountExecutor[D, I]) MaxTime(d time.Duration) *CountExecutor[D, I]
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
func (*CountExecutor[D, I]) Primary ¶
func (c *CountExecutor[D, I]) Primary() *CountExecutor[D, I]
func (*CountExecutor[D, I]) Skip ¶
func (c *CountExecutor[D, I]) Skip(i int64) *CountExecutor[D, I]
Skip sets the value for the Skip field.
type DatabaseAggregateExecutor ¶
type DatabaseAggregateExecutor struct {
// contains filtered or unexported fields
}
func NewDatabaseAggregateExecutor ¶
func NewDatabaseAggregateExecutor(readprefPrimary, readprefDefault *raw.Database, pipe aggregate.Pipeline) *DatabaseAggregateExecutor
func (*DatabaseAggregateExecutor) AllowDiskUse ¶
func (a *DatabaseAggregateExecutor) AllowDiskUse() *DatabaseAggregateExecutor
AllowDiskUse sets the value for the AllowDiskUse field.
func (*DatabaseAggregateExecutor) BatchSize ¶
func (a *DatabaseAggregateExecutor) BatchSize(i int32) *DatabaseAggregateExecutor
BatchSize sets the value for the BatchSize field.
func (*DatabaseAggregateExecutor) BypassDocumentValidation ¶
func (a *DatabaseAggregateExecutor) BypassDocumentValidation() *DatabaseAggregateExecutor
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*DatabaseAggregateExecutor) Collation ¶
func (a *DatabaseAggregateExecutor) Collation(c *options.Collation) *DatabaseAggregateExecutor
Collation sets the value for the Collation field.
func (*DatabaseAggregateExecutor) Comment ¶
func (a *DatabaseAggregateExecutor) Comment(s string) *DatabaseAggregateExecutor
Comment sets the value for the Comment field.
func (*DatabaseAggregateExecutor) Custom ¶
func (a *DatabaseAggregateExecutor) Custom(c rawbson.M) *DatabaseAggregateExecutor
Custom sets the value for the Custom field. Key-value pairs of the BSON map should correlate with desired option names and values. Values must be Marshalable. Custom options may conflict with non-custom options, and custom options bypass client-side validation. Prefer using non-custom options where possible.
func (*DatabaseAggregateExecutor) ExecuteTo ¶
func (a *DatabaseAggregateExecutor) ExecuteTo(ctx context.Context, result interface{}) error
func (*DatabaseAggregateExecutor) Hint ¶
func (a *DatabaseAggregateExecutor) Hint(index string) *DatabaseAggregateExecutor
Hint sets the value for the Hint field.
func (*DatabaseAggregateExecutor) Let ¶
func (a *DatabaseAggregateExecutor) Let(let rawbson.M) *DatabaseAggregateExecutor
Let sets the value for the Let field.
func (*DatabaseAggregateExecutor) MaxAwaitTime ¶
func (a *DatabaseAggregateExecutor) MaxAwaitTime(d time.Duration) *DatabaseAggregateExecutor
MaxAwaitTime sets the value for the MaxAwaitTime field.
func (*DatabaseAggregateExecutor) MaxTime ¶
func (a *DatabaseAggregateExecutor) MaxTime(d time.Duration) *DatabaseAggregateExecutor
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
func (*DatabaseAggregateExecutor) Primary ¶
func (a *DatabaseAggregateExecutor) Primary() *DatabaseAggregateExecutor
type DeleteExecutor ¶
func NewDeleteManyExecutor ¶
func NewDeleteManyExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, filter *filters.Filter) *DeleteExecutor[D, I]
func NewDeleteOneExecutor ¶
func NewDeleteOneExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, filter *filters.Filter) *DeleteExecutor[D, I]
func (*DeleteExecutor[D, I]) Collation ¶
func (d *DeleteExecutor[D, I]) Collation(c *options.Collation) *DeleteExecutor[D, I]
Collation sets the value for the Collation field.
func (*DeleteExecutor[D, I]) Comment ¶
func (d *DeleteExecutor[D, I]) Comment(comment string) *DeleteExecutor[D, I]
Comment sets the value for the Comment field.
func (*DeleteExecutor[D, I]) Execute ¶
func (d *DeleteExecutor[D, I]) Execute(ctx context.Context) (int64, error)
func (*DeleteExecutor[D, I]) Hint ¶
func (d *DeleteExecutor[D, I]) Hint(index string) *DeleteExecutor[D, I]
Hint sets the value for the Hint field.
func (*DeleteExecutor[D, I]) Let ¶
func (d *DeleteExecutor[D, I]) Let(let rawbson.M) *DeleteExecutor[D, I]
Let sets the value for the Let field.
type DistinctExecutor ¶
type DistinctExecutor struct {
// contains filtered or unexported fields
}
func NewDistinctExecutor ¶
func NewDistinctExecutor(readprefPrimary, readprefDefault *raw.Collection, field string) *DistinctExecutor
func (*DistinctExecutor) Collation ¶
func (do *DistinctExecutor) Collation(c *options.Collation) *DistinctExecutor
Collation sets the value for the Collation field.
func (*DistinctExecutor) Comment ¶
func (do *DistinctExecutor) Comment(comment string) *DistinctExecutor
Comment sets the value for the Comment field.
func (*DistinctExecutor) Execute ¶
func (do *DistinctExecutor) Execute(ctx context.Context) ([]any, error)
func (*DistinctExecutor) MaxTime ¶
func (do *DistinctExecutor) MaxTime(d time.Duration) *DistinctExecutor
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
func (*DistinctExecutor) Primary ¶
func (do *DistinctExecutor) Primary() *DistinctExecutor
type FindExecutor ¶
func NewFindExecutor ¶
func NewFindExecutor[D bson.Doc[I], I bson.ID]( readprefPrimary, readprefDefault *raw.Collection, filter *filters.Filter, ) *FindExecutor[D, I]
func (*FindExecutor[D, I]) AllowDiskUse ¶
func (f *FindExecutor[D, I]) AllowDiskUse() *FindExecutor[D, I]
AllowDiskUse sets the value for the AllowDiskUse field.
func (*FindExecutor[D, I]) AllowPartialResults ¶
func (f *FindExecutor[D, I]) AllowPartialResults() *FindExecutor[D, I]
AllowPartialResults sets the value for the AllowPartialResults field.
func (*FindExecutor[D, I]) BatchSize ¶
func (f *FindExecutor[D, I]) BatchSize(i int32) *FindExecutor[D, I]
BatchSize sets the value for the BatchSize field.
func (*FindExecutor[D, I]) Collation ¶
func (f *FindExecutor[D, I]) Collation(collation *options.Collation) *FindExecutor[D, I]
Collation sets the value for the Collation field.
func (*FindExecutor[D, I]) Collect ¶
func (f *FindExecutor[D, I]) Collect(ctx context.Context, data any) error
func (*FindExecutor[D, I]) Comment ¶
func (f *FindExecutor[D, I]) Comment(comment string) *FindExecutor[D, I]
Comment sets the value for the Comment field.
func (*FindExecutor[D, I]) Cursor ¶
func (f *FindExecutor[D, I]) Cursor(ctx context.Context) (*FindIterator[D, I], error)
func (*FindExecutor[D, I]) CursorType ¶
func (f *FindExecutor[D, I]) CursorType(ct options.CursorType) *FindExecutor[D, I]
CursorType sets the value for the CursorType field.
func (*FindExecutor[D, I]) Hint ¶
func (f *FindExecutor[D, I]) Hint(index string) *FindExecutor[D, I]
Hint sets the value for the Hint field.
func (*FindExecutor[D, I]) Let ¶
func (f *FindExecutor[D, I]) Let(let rawbson.M) *FindExecutor[D, I]
Let sets the value for the Let field.
func (*FindExecutor[D, I]) Limit ¶
func (f *FindExecutor[D, I]) Limit(limit int64) *FindExecutor[D, I]
func (*FindExecutor[D, I]) Max ¶
func (f *FindExecutor[D, I]) Max(max int) *FindExecutor[D, I]
Max sets the value for the Max field.
func (*FindExecutor[D, I]) MaxAwaitTime ¶
func (f *FindExecutor[D, I]) MaxAwaitTime(d time.Duration) *FindExecutor[D, I]
MaxAwaitTime sets the value for the MaxAwaitTime field.
func (*FindExecutor[D, I]) MaxTime ¶
func (f *FindExecutor[D, I]) MaxTime(d time.Duration) *FindExecutor[D, I]
MaxTime specifies the max time to allow the query to run.
func (*FindExecutor[D, I]) Min ¶
func (f *FindExecutor[D, I]) Min(min int) *FindExecutor[D, I]
Min sets the value for the Min field.
func (*FindExecutor[D, I]) NoCursorTimeout ¶
func (f *FindExecutor[D, I]) NoCursorTimeout() *FindExecutor[D, I]
NoCursorTimeout sets the value for the NoCursorTimeout field.
func (*FindExecutor[D, I]) OplogReplay
deprecated
func (f *FindExecutor[D, I]) OplogReplay() *FindExecutor[D, I]
OplogReplay sets the value for the OplogReplay field.
Deprecated: This option has been deprecated in MongoDB version 4.4 and will be ignored by the server if it is set.
func (*FindExecutor[D, I]) Primary ¶
func (f *FindExecutor[D, I]) Primary() *FindExecutor[D, I]
func (*FindExecutor[D, I]) Projection ¶ added in v0.0.26
func (f *FindExecutor[D, I]) Projection(projection *projections.Options) *FindExecutor[D, I]
func (*FindExecutor[D, I]) ReturnKey ¶
func (f *FindExecutor[D, I]) ReturnKey() *FindExecutor[D, I]
ReturnKey sets the value for the ReturnKey field.
func (*FindExecutor[D, I]) ShowRecordID ¶
func (f *FindExecutor[D, I]) ShowRecordID() *FindExecutor[D, I]
ShowRecordID sets the value for the ShowRecordID field.
func (*FindExecutor[D, I]) Skip ¶
func (f *FindExecutor[D, I]) Skip(skip int64) *FindExecutor[D, I]
func (*FindExecutor[D, I]) Snapshot
deprecated
func (f *FindExecutor[D, I]) Snapshot() *FindExecutor[D, I]
Snapshot sets the value for the Snapshot field.
Deprecated: This option has been deprecated in MongoDB version 3.6 and removed in MongoDB version 4.0.
func (*FindExecutor[D, I]) Sort ¶
func (f *FindExecutor[D, I]) Sort(sort *sorts.Options) *FindExecutor[D, I]
type FindIterator ¶
func (*FindIterator[D, I]) Next ¶
func (f *FindIterator[D, I]) Next() (D, error)
func (*FindIterator[D, I]) TryHasNext ¶ added in v0.0.26
func (f *FindIterator[D, I]) TryHasNext(ctx context.Context) bool
type FindOneAndUpdateExecutor ¶
type FindOneAndUpdateExecutor[D bson.Doc[I], I bson.ID] struct { // contains filtered or unexported fields }
func (*FindOneAndUpdateExecutor[D, I]) ArrayFilters ¶
func (f *FindOneAndUpdateExecutor[D, I]) ArrayFilters(af options.ArrayFilters) *FindOneAndUpdateExecutor[D, I]
ArrayFilters sets the value for the ArrayFilters field.
func (*FindOneAndUpdateExecutor[D, I]) BypassDocumentValidation ¶
func (f *FindOneAndUpdateExecutor[D, I]) BypassDocumentValidation() *FindOneAndUpdateExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*FindOneAndUpdateExecutor[D, I]) Collation ¶
func (f *FindOneAndUpdateExecutor[D, I]) Collation(collation *options.Collation) *FindOneAndUpdateExecutor[D, I]
Collation sets the value for the Collation field.
func (*FindOneAndUpdateExecutor[D, I]) Comment ¶
func (f *FindOneAndUpdateExecutor[D, I]) Comment(comment interface{}) *FindOneAndUpdateExecutor[D, I]
Comment sets the value for the Comment field.
func (*FindOneAndUpdateExecutor[D, I]) Execute ¶
func (f *FindOneAndUpdateExecutor[D, I]) Execute(ctx context.Context) (D, error)
func (*FindOneAndUpdateExecutor[D, I]) Hint ¶
func (f *FindOneAndUpdateExecutor[D, I]) Hint(index string) *FindOneAndUpdateExecutor[D, I]
Hint sets the value for the Hint field.
func (*FindOneAndUpdateExecutor[D, I]) Let ¶
func (f *FindOneAndUpdateExecutor[D, I]) Let(l rawbson.M) *FindOneAndUpdateExecutor[D, I]
Let sets the value for the Let field.
func (*FindOneAndUpdateExecutor[D, I]) MaxTime ¶
func (f *FindOneAndUpdateExecutor[D, I]) MaxTime(d time.Duration) *FindOneAndUpdateExecutor[D, I]
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
func (*FindOneAndUpdateExecutor[D, I]) Projection ¶
func (f *FindOneAndUpdateExecutor[D, I]) Projection(projection *projections.Options) *FindOneAndUpdateExecutor[D, I]
Projection sets the value for the Projection field.
func (*FindOneAndUpdateExecutor[D, I]) ReturnAfter ¶
func (f *FindOneAndUpdateExecutor[D, I]) ReturnAfter() *FindOneAndUpdateExecutor[D, I]
func (*FindOneAndUpdateExecutor[D, I]) ReturnBefore ¶
func (f *FindOneAndUpdateExecutor[D, I]) ReturnBefore() *FindOneAndUpdateExecutor[D, I]
func (*FindOneAndUpdateExecutor[D, I]) Sort ¶
func (f *FindOneAndUpdateExecutor[D, I]) Sort(sort *sorts.Options) *FindOneAndUpdateExecutor[D, I]
Sort sets the value for the Sort field.
func (*FindOneAndUpdateExecutor[D, I]) Upsert ¶
func (f *FindOneAndUpdateExecutor[D, I]) Upsert() *FindOneAndUpdateExecutor[D, I]
Upsert sets the value for the Upsert field.
type FindOneExecutor ¶
func NewFindOneExecutor ¶
func NewFindOneExecutor[D bson.Doc[I], I bson.ID](readprefPrimary, readprefDefault *raw.Collection, filter *filters.Filter) *FindOneExecutor[D, I]
func (*FindOneExecutor[D, I]) AllowPartialResults ¶
func (f *FindOneExecutor[D, I]) AllowPartialResults() *FindOneExecutor[D, I]
AllowPartialResults sets the value for the AllowPartialResults field.
func (*FindOneExecutor[D, I]) Collation ¶
func (f *FindOneExecutor[D, I]) Collation(collation *options.Collation) *FindOneExecutor[D, I]
Collation sets the value for the Collation field.
func (*FindOneExecutor[D, I]) Comment ¶
func (f *FindOneExecutor[D, I]) Comment(comment string) *FindOneExecutor[D, I]
Comment sets the value for the Comment field.
func (*FindOneExecutor[D, I]) Execute ¶
func (f *FindOneExecutor[D, I]) Execute(ctx context.Context) (D, error)
func (*FindOneExecutor[D, I]) ExecuteTo ¶
func (f *FindOneExecutor[D, I]) ExecuteTo(ctx context.Context, data any) error
func (*FindOneExecutor[D, I]) Hint ¶
func (f *FindOneExecutor[D, I]) Hint(index string) *FindOneExecutor[D, I]
Hint sets the value for the Hint field.
func (*FindOneExecutor[D, I]) Max ¶
func (f *FindOneExecutor[D, I]) Max(max int) *FindOneExecutor[D, I]
Max sets the value for the Max field.
func (*FindOneExecutor[D, I]) MaxAwaitTime ¶
func (f *FindOneExecutor[D, I]) MaxAwaitTime(d time.Duration) *FindOneExecutor[D, I]
MaxAwaitTime sets the value for the MaxAwaitTime field.
func (*FindOneExecutor[D, I]) MaxTime ¶
func (f *FindOneExecutor[D, I]) MaxTime(d time.Duration) *FindOneExecutor[D, I]
MaxTime specifies the max time to allow the query to run.
func (*FindOneExecutor[D, I]) Min ¶
func (f *FindOneExecutor[D, I]) Min(min int) *FindOneExecutor[D, I]
Min sets the value for the Min field.
func (*FindOneExecutor[D, I]) OplogReplay
deprecated
func (f *FindOneExecutor[D, I]) OplogReplay() *FindOneExecutor[D, I]
OplogReplay sets the value for the OplogReplay field.
Deprecated: This option has been deprecated in MongoDB version 4.4 and will be ignored by the server if it is set.
func (*FindOneExecutor[D, I]) Primary ¶
func (f *FindOneExecutor[D, I]) Primary() *FindOneExecutor[D, I]
func (*FindOneExecutor[D, I]) ReturnKey ¶
func (f *FindOneExecutor[D, I]) ReturnKey() *FindOneExecutor[D, I]
ReturnKey sets the value for the ReturnKey field.
func (*FindOneExecutor[D, I]) ShowRecordID ¶
func (f *FindOneExecutor[D, I]) ShowRecordID() *FindOneExecutor[D, I]
ShowRecordID sets the value for the ShowRecordID field.
func (*FindOneExecutor[D, I]) Skip ¶
func (f *FindOneExecutor[D, I]) Skip(skip int64) *FindOneExecutor[D, I]
func (*FindOneExecutor[D, I]) Snapshot
deprecated
func (f *FindOneExecutor[D, I]) Snapshot() *FindOneExecutor[D, I]
Snapshot sets the value for the Snapshot field.
Deprecated: This option has been deprecated in MongoDB version 3.6 and removed in MongoDB version 4.0.
func (*FindOneExecutor[D, I]) Sort ¶
func (f *FindOneExecutor[D, I]) Sort(sort *sorts.Options) *FindOneExecutor[D, I]
type InsertManyExecutor ¶
type InsertManyExecutor[D bson.Doc[I], I bson.ID] struct { // contains filtered or unexported fields }
func NewInsertManyExecutor ¶
func NewInsertManyExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, docs ...D) *InsertManyExecutor[D, I]
func (*InsertManyExecutor[D, I]) Add ¶
func (i *InsertManyExecutor[D, I]) Add(docs ...D) *InsertManyExecutor[D, I]
func (*InsertManyExecutor[D, I]) BypassDocumentValidation ¶
func (i *InsertManyExecutor[D, I]) BypassDocumentValidation() *InsertManyExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*InsertManyExecutor[D, I]) Comment ¶
func (i *InsertManyExecutor[D, I]) Comment(comment string) *InsertManyExecutor[D, I]
Comment sets the value for the Comment field.
func (*InsertManyExecutor[D, I]) Execute ¶
func (i *InsertManyExecutor[D, I]) Execute(ctx context.Context) ([]I, error)
func (*InsertManyExecutor[D, I]) SetOrdered ¶
func (i *InsertManyExecutor[D, I]) SetOrdered() *InsertManyExecutor[D, I]
SetOrdered sets the value for the Ordered field.
type InsertOneExecutor ¶
type InsertOneExecutor[D bson.Doc[I], I bson.ID] struct { // contains filtered or unexported fields }
func NewInsertOneExecutor ¶
func NewInsertOneExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, doc D) *InsertOneExecutor[D, I]
func (*InsertOneExecutor[D, I]) BypassDocumentValidation ¶
func (i *InsertOneExecutor[D, I]) BypassDocumentValidation() *InsertOneExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*InsertOneExecutor[D, I]) Comment ¶
func (i *InsertOneExecutor[D, I]) Comment(comment string) *InsertOneExecutor[D, I]
Comment sets the value for the Comment field.
type UpdateExecutor ¶
func NewUpdateByIdExecutor ¶
func NewUpdateByIdExecutor[D bson.Doc[I], I bson.ID](primary *mongo.Collection, id I, update *update.Update) *UpdateExecutor[D, I]
func NewUpdateManyExecutor ¶
func NewUpdateOneExecutor ¶
func (*UpdateExecutor[D, I]) ArrayFilters ¶
func (u *UpdateExecutor[D, I]) ArrayFilters(af options.ArrayFilters) *UpdateExecutor[D, I]
func (*UpdateExecutor[D, I]) BypassDocumentValidation ¶
func (u *UpdateExecutor[D, I]) BypassDocumentValidation() *UpdateExecutor[D, I]
BypassDocumentValidation sets the value for the BypassDocumentValidation field.
func (*UpdateExecutor[D, I]) Collation ¶
func (u *UpdateExecutor[D, I]) Collation(c *options.Collation) *UpdateExecutor[D, I]
Collation sets the value for the Collation field.
func (*UpdateExecutor[D, I]) Execute ¶
func (u *UpdateExecutor[D, I]) Execute(ctx context.Context) (*model.UpdateResult[I], error)
func (*UpdateExecutor[D, I]) Hint ¶
func (u *UpdateExecutor[D, I]) Hint(index string) *UpdateExecutor[D, I]
Hint sets the value for the Hint field.
func (*UpdateExecutor[D, I]) Let ¶
func (u *UpdateExecutor[D, I]) Let(l rawbson.M) *UpdateExecutor[D, I]
Let sets the value for the Let field.
func (*UpdateExecutor[D, I]) Upsert ¶
func (u *UpdateExecutor[D, I]) Upsert() *UpdateExecutor[D, I]
Upsert sets the value for the Upsert field.