Struct mongodb::options::ChangeStreamOptions
source · [−]#[non_exhaustive]pub struct ChangeStreamOptions {
pub full_document: Option<FullDocumentType>,
pub resume_after: Option<ResumeToken>,
pub start_at_operation_time: Option<Timestamp>,
pub start_after: Option<ResumeToken>,
pub max_await_time: Option<Duration>,
pub batch_size: Option<u32>,
pub collation: Option<Collation>,
pub read_concern: Option<ReadConcern>,
pub selection_criteria: Option<SelectionCriteria>,
/* private fields */
}
Expand description
These are the valid options that can be passed to the watch
method for creating a
ChangeStream
.
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.full_document: Option<FullDocumentType>
When set to FullDocumentType::UpdateLookup
, the
ChangeStreamEvent::full_document
field will be populated with a copy of the entire document that was
updated from some time after the change occurred when an “update” event occurs. By
default, the full_document
field will be empty for updates.
resume_after: Option<ResumeToken>
Specifies the logical starting point for the new change stream. Note that if a watched
collection is dropped and recreated or newly renamed, start_after
should be set instead.
resume_after
and start_after
cannot be set simultaneously.
For more information on resuming a change stream see the documentation here
start_at_operation_time: Option<Timestamp>
The change stream will only provide changes that occurred at or after the specified timestamp. Any command run against the server will return an operation time that can be used here.
start_after: Option<ResumeToken>
Takes a resume token and starts a new change stream returning the first notification after the token. This will allow users to watch collections that have been dropped and recreated or newly renamed collections without missing any notifications.
This feature is only available on MongoDB 4.2+.
See the documentation here for more information.
max_await_time: Option<Duration>
The maximum amount of time for the server to wait on new documents to satisfy a change stream query.
batch_size: Option<u32>
The number of documents to return per batch.
collation: Option<Collation>
Specifies a collation.
read_concern: Option<ReadConcern>
The read concern to use for the operation.
If none is specified, the read concern defined on the object executing this operation will be used.
selection_criteria: Option<SelectionCriteria>
The criteria used to select a server for this operation.
If none is specified, the selection criteria defined on the object executing this operation will be used.
Implementations
sourceimpl ChangeStreamOptions
impl ChangeStreamOptions
sourcepub fn builder(
) -> ChangeStreamOptionsBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder(
) -> ChangeStreamOptionsBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building ChangeStreamOptions
.
On the builder, call .full_document(...)
(optional), .resume_after(...)
(optional), .start_at_operation_time(...)
(optional), .start_after(...)
(optional), .max_await_time(...)
(optional), .batch_size(...)
(optional), .collation(...)
(optional), .read_concern(...)
(optional), .selection_criteria(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of ChangeStreamOptions
.
Trait Implementations
sourceimpl Clone for ChangeStreamOptions
impl Clone for ChangeStreamOptions
sourcefn clone(&self) -> ChangeStreamOptions
fn clone(&self) -> ChangeStreamOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ChangeStreamOptions
impl Debug for ChangeStreamOptions
sourceimpl Default for ChangeStreamOptions
impl Default for ChangeStreamOptions
sourcefn default() -> ChangeStreamOptions
fn default() -> ChangeStreamOptions
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for ChangeStreamOptions
impl<'de> Deserialize<'de> for ChangeStreamOptions
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 Serialize for ChangeStreamOptions
impl Serialize for ChangeStreamOptions
Auto Trait Implementations
impl !RefUnwindSafe for ChangeStreamOptions
impl Send for ChangeStreamOptions
impl Sync for ChangeStreamOptions
impl Unpin for ChangeStreamOptions
impl !UnwindSafe for ChangeStreamOptions
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more