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]
fn new(client: &'a Client) -> OplogBuilder<'a>
[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. }
fn build(&self) -> Result<Oplog>
[src]
Executes the query and builds the Oplog
.
fn filter(&mut self, filter: Option<Document>) -> &mut OplogBuilder<'a>
[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]
fn clone(&self) -> OplogBuilder<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more