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 full_document: 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: ResumeToken
An 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: OperationType
Describes 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.
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.
Trait Implementations
sourceimpl<T: Debug> Debug for ChangeStreamEvent<T>
impl<T: Debug> Debug for ChangeStreamEvent<T>
sourceimpl<'de, T> Deserialize<'de> for ChangeStreamEvent<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ChangeStreamEvent<T> where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: PartialEq> PartialEq<ChangeStreamEvent<T>> for ChangeStreamEvent<T>
impl<T: PartialEq> PartialEq<ChangeStreamEvent<T>> for ChangeStreamEvent<T>
sourcefn eq(&self, other: &ChangeStreamEvent<T>) -> bool
fn eq(&self, other: &ChangeStreamEvent<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ChangeStreamEvent<T>) -> bool
fn ne(&self, other: &ChangeStreamEvent<T>) -> bool
This method tests for !=
.
sourceimpl<T> Serialize for ChangeStreamEvent<T> where
T: Serialize,
impl<T> Serialize for ChangeStreamEvent<T> where
T: Serialize,
impl<T> StructuralPartialEq for ChangeStreamEvent<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ChangeStreamEvent<T> where
T: RefUnwindSafe,
impl<T> Send for ChangeStreamEvent<T> where
T: Send,
impl<T> Sync for ChangeStreamEvent<T> where
T: Sync,
impl<T> Unpin for ChangeStreamEvent<T> where
T: Unpin,
impl<T> UnwindSafe for ChangeStreamEvent<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more