Struct mongo_driver::collection::BulkOperation [] [src]

pub struct BulkOperation<'a> { /* fields omitted */ }

Provides an abstraction for submitting multiple write operations as a single batch.

Create a BulkOperation by calling create_bulk_operation on a Collection. After adding all of the write operations using the functions on this struct, execute to execute the operation on the server in batches. After executing the bulk operation is consumed and cannot be used anymore.

Methods

impl<'a> BulkOperation<'a>
[src]

[src]

Queue an insert of a single document into a bulk operation. The insert is not performed until execute is called.

[src]

Queue removal of all documents matching the provided selector into a bulk operation. The removal is not performed until execute is called.

[src]

Queue removal of a single document into a bulk operation. The removal is not performed until execute is called.

[src]

Queue replacement of a single document into a bulk operation. The replacement is not performed until execute is called.

[src]

Queue update of a single documents into a bulk operation. The update is not performed until execute is called.

TODO: document must only contain fields whose key starts with $, these is no error handling for this.

[src]

Queue update of multiple documents into a bulk operation. The update is not performed until execute is called.

TODO: document must only contain fields whose key starts with $, these is no error handling for this.

[src]

This function executes all operations queued into this bulk operation. If ordered was set true, forward progress will be stopped upon the first error.

This function takes ownership because it is not possible to execute a bulk operation multiple times.

Returns a document with an overview of the bulk operation if successfull.

Trait Implementations

impl<'a> Drop for BulkOperation<'a>
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a> !Send for BulkOperation<'a>

impl<'a> !Sync for BulkOperation<'a>