Struct oplog::OplogBuilder [] [src]

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

A builder for an Oplog.

This builder enables configuring a filter on the oplog so that only operations matching a given criteria are returned (e.g. to set a start time or filter out unwanted operation types).

The lifetime 'a refers to the lifetime of the MongoDB client.

Methods

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

[src]

Create a new builder for the given MongoDB client.

The oplog is not built until build is called.

Example

use mongodb::{Client, ThreadedClient};
use oplog::OplogBuilder;

let client = Client::connect("localhost", 27017).expect("Failed to connect to MongoDB.");

if let Ok(oplog) = OplogBuilder::new(&client).build() {
    // Do something with oplog.
}

[src]

Executes the query and builds the Oplog.

[src]

Provide an optional filter for the oplog.

This is empty by default so all operations are returned.

Example

use mongodb::{Client, ThreadedClient};
use oplog::OplogBuilder;

let client = Client::connect("localhost", 27017).expect("Failed to connect to MongoDB.");

if let Ok(oplog) = OplogBuilder::new(&client).filter(Some(doc! { "op" => "i" })).build() {
    // Do something with filtered oplog.
}

Trait Implementations

impl<'a> Clone for OplogBuilder<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more