operation

package
v0.0.0-...-8c8387d Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

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

Performs an aggregate operation

func NewAggregate

func NewAggregate(pipeline bsoncore.Document) *Aggregate

NewAggregate constructs and returns a new Aggregate.

func (*Aggregate) AllowDiskUse

func (a *Aggregate) AllowDiskUse(allowDiskUse bool) *Aggregate

AllowDiskUse enables writing to temporary files. When true, aggregation stages can write to the dbPath/_tmp directory.

func (*Aggregate) BatchSize

func (a *Aggregate) BatchSize(batchSize int32) *Aggregate

BatchSize specifies the number of documents to return in every batch.

func (*Aggregate) BypassDocumentValidation

func (a *Aggregate) BypassDocumentValidation(bypassDocumentValidation bool) *Aggregate

BypassDocumentValidation allows the write to opt-out of document level validation. This only applies when the $out stage is specified.

func (*Aggregate) ClusterClock

func (a *Aggregate) ClusterClock(clock *session.ClusterClock) *Aggregate

ClusterClock sets the cluster clock for this operation.

func (*Aggregate) Collation

func (a *Aggregate) Collation(collation bsoncore.Document) *Aggregate

Collation specifies a collation. This option is only valid for server versions 3.4 and above.

func (*Aggregate) Collection

func (a *Aggregate) Collection(collection string) *Aggregate

Collection sets the collection that this command will run against.

func (*Aggregate) CommandMonitor

func (a *Aggregate) CommandMonitor(monitor *event.CommandMonitor) *Aggregate

CommandMonitor sets the monitor to use for APM events.

func (*Aggregate) Comment

func (a *Aggregate) Comment(comment string) *Aggregate

Comment specifies an arbitrary string to help trace the operation through the database profiler, currentOp, and logs.

func (*Aggregate) Crypt

func (a *Aggregate) Crypt(crypt *driver.Crypt) *Aggregate

Crypt sets the Crypt object to use for automatic encryption and decryption.

func (*Aggregate) Database

func (a *Aggregate) Database(database string) *Aggregate

Database sets the database to run this operation against.

func (*Aggregate) Deployment

func (a *Aggregate) Deployment(deployment driver.Deployment) *Aggregate

Deployment sets the deployment to use for this operation.

func (*Aggregate) Execute

func (a *Aggregate) Execute(ctx context.Context) error

Execute runs this operations and returns an error if the operaiton did not execute successfully.

func (*Aggregate) Hint

func (a *Aggregate) Hint(hint bsoncore.Value) *Aggregate

Hint specifies the index to use.

func (*Aggregate) MaxTimeMS

func (a *Aggregate) MaxTimeMS(maxTimeMS int64) *Aggregate

MaxTimeMS specifies the maximum amount of time to allow the query to run.

func (*Aggregate) Pipeline

func (a *Aggregate) Pipeline(pipeline bsoncore.Document) *Aggregate

Pipeline determines how data is transformed for an aggregation.

func (*Aggregate) ReadConcern

func (a *Aggregate) ReadConcern(readConcern *readconcern.ReadConcern) *Aggregate

ReadConcern specifies the read concern for this operation.

func (*Aggregate) ReadPreference

func (a *Aggregate) ReadPreference(readPreference *readpref.ReadPref) *Aggregate

ReadPreference set the read prefernce used with this operation.

func (*Aggregate) Result

func (a *Aggregate) Result(opts driver.CursorOptions) (*driver.BatchCursor, error)

Result returns the result of executing this operation.

func (*Aggregate) ResultCursorResponse

func (a *Aggregate) ResultCursorResponse() driver.CursorResponse

func (*Aggregate) Retry

func (a *Aggregate) Retry(retry driver.RetryMode) *Aggregate

Retry enables retryable writes for this operation. Retries are not handled automatically, instead a boolean is returned from Execute and SelectAndExecute that indicates if the operation can be retried. Retrying is handled by calling RetryExecute.

func (*Aggregate) ServerSelector

func (a *Aggregate) ServerSelector(selector description.ServerSelector) *Aggregate

ServerSelector sets the selector used to retrieve a server.

func (*Aggregate) Session

func (a *Aggregate) Session(session *session.Client) *Aggregate

Session sets the session for this operation.

func (*Aggregate) WriteConcern

func (a *Aggregate) WriteConcern(writeConcern *writeconcern.WriteConcern) *Aggregate

WriteConcern sets the write concern for this operation.

Jump to

Keyboard shortcuts

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