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
Noop
A no-op as inserted periodically by MongoDB or used to initiate new replica sets.
Fields of Noop
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
message: String | The message associated with this operation. |
Insert
An insert of a document into a specific database and collection.
Fields of Insert
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
namespace: String | The full namespace of the operation including its database and collection. |
document: Document | The BSON document inserted into the namespace. |
Update
An update of a document in a specific database and collection matching a given query.
Fields of Update
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
namespace: String | The full namespace of the operation including its database and collection. |
query: Document | The BSON selection criteria for the update. |
update: Document | The BSON update applied in this operation. |
Delete
The deletion of a document in a specific database and collection matching a given query.
Fields of Delete
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
namespace: String | The full namespace of the operation including its database and collection. |
query: Document | The BSON selection criteria for the delete. |
Command
A command such as the creation or deletion of a collection.
Fields of Command
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
namespace: String | The full namespace of the operation including its database and collection. |
command: Document | The BSON command. |
ApplyOps
A command to apply multiple oplog operations at once.
Fields of ApplyOps
id: i64 | A unique identifier for this operation. |
timestamp: DateTime<UTC> | The time of the operation. |
namespace: String | The full namespace of the operation including its database and collection. |
operations: Vec<Operation> | A vector of operations to apply. |
Methods
impl Operation
[src]
fn new(document: &Document) -> Result<Operation>
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]
fn clone(&self) -> Operation
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Operation
[src]
impl PartialEq for Operation
[src]
fn eq(&self, __arg_0: &Operation) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Operation) -> bool
This method tests for !=
.