Struct mongodb::change_stream::event::ChangeStreamEvent
source · [−]#[non_exhaustive]pub struct ChangeStreamEvent<T> {
pub id: ResumeToken,
pub operation_type: OperationType,
pub ns: Option<ChangeNamespace>,
pub to: Option<ChangeNamespace>,
pub document_key: Option<Document>,
pub update_description: Option<UpdateDescription>,
pub cluster_time: Option<Timestamp>,
pub wall_time: Option<DateTime>,
pub full_document: Option<T>,
pub full_document_before_change: Option<T>,
}Expand description
A ChangeStreamEvent represents a
change event in the associated change stream.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: ResumeTokenAn opaque token for use when resuming an interrupted ChangeStream.
See the documentation here for more information on resume tokens.
Also see the documentation on resuming a change stream.
operation_type: OperationTypeDescribes the type of operation represented in this change notification.
ns: Option<ChangeNamespace>Identifies the collection or database on which the event occurred.
to: Option<ChangeNamespace>The new name for the ns collection. Only included for OperationType::Rename.
document_key: Option<Document>A Document that contains the _id of the document created or modified by the insert,
replace, delete, update operations (i.e. CRUD operations). For sharded collections,
also displays the full shard key for the document. The _id field is not repeated if it is
already a part of the shard key.
update_description: Option<UpdateDescription>A description of the fields that were updated or removed by the update operation.
Only specified if operation_type is OperationType::Update.
cluster_time: Option<Timestamp>The cluster time at which the change occurred.
wall_time: Option<DateTime>The wall time from the mongod that the change event originated from.
full_document: Option<T>The Document created or modified by the insert, replace, delete, update
operations (i.e. CRUD operations).
For insert and replace operations, this represents the new document created by the
operation. For delete operations, this field is None.
For update operations, this field only appears if you configured the change stream with
full_document set to
UpdateLookup. This field then
represents the most current majority-committed version of the document modified by the
update operation.
full_document_before_change: Option<T>Contains the pre-image of the modified or deleted document if the pre-image is available
for the change event and either Required or WhenAvailable was specified for the
full_document_before_change option when creating the
change stream. If WhenAvailable was specified but the pre-image is unavailable, this
will be explicitly set to None.