Enum oplog::Operation [] [src]

pub enum Operation {
    Noop {
        id: i64,
        timestamp: DateTime<UTC>,
        message: String,
    },
    Insert {
        id: i64,
        timestamp: DateTime<UTC>,
        namespace: String,
        document: Document,
    },
    Update {
        id: i64,
        timestamp: DateTime<UTC>,
        namespace: String,
        query: Document,
        update: Document,
    },
    Delete {
        id: i64,
        timestamp: DateTime<UTC>,
        namespace: String,
        query: Document,
    },
    Command {
        id: i64,
        timestamp: DateTime<UTC>,
        namespace: String,
        command: Document,
    },
    ApplyOps {
        id: i64,
        timestamp: DateTime<UTC>,
        namespace: String,
        operations: Vec<Operation>,
    },
}

A MongoDB oplog operation.

Variants

A no-op as inserted periodically by MongoDB or used to initiate new replica sets.

Fields of Noop

A unique identifier for this operation.

The time of the operation.

The message associated with this operation.

An insert of a document into a specific database and collection.

Fields of Insert

A unique identifier for this operation.

The time of the operation.

The full namespace of the operation including its database and collection.

The BSON document inserted into the namespace.

An update of a document in a specific database and collection matching a given query.

Fields of Update

A unique identifier for this operation.

The time of the operation.

The full namespace of the operation including its database and collection.

The BSON selection criteria for the update.

The BSON update applied in this operation.

The deletion of a document in a specific database and collection matching a given query.

Fields of Delete

A unique identifier for this operation.

The time of the operation.

The full namespace of the operation including its database and collection.

The BSON selection criteria for the delete.

A command such as the creation or deletion of a collection.

Fields of Command

A unique identifier for this operation.

The time of the operation.

The full namespace of the operation including its database and collection.

The BSON command.

A command to apply multiple oplog operations at once.

Fields of ApplyOps

A unique identifier for this operation.

The time of the operation.

The full namespace of the operation including its database and collection.

A vector of operations to apply.

Methods

impl Operation
[src]

Try to create a new Operation from a BSON document.

Example

use oplog::Operation;

let document = doc! {
    "ts" => (Bson::TimeStamp(1479561394 << 32)),
    "h" => (-1742072865587022793i64),
    "v" => 2,
    "op" => "i",
    "ns" => "foo.bar",
    "o" => {
        "foo" => "bar"
    }
};
let operation = Operation::new(&document);

Trait Implementations

impl Clone for Operation
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Operation
[src]

Formats the value using the given formatter.

impl PartialEq for Operation
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Display for Operation
[src]

Formats the value using the given formatter. Read more