/// Atomically finds up to one document in the collection matching `filter` and replaces it with
/// `replacement` using the provided `ClientSession`.
///
/// This operation will retry once upon failure if the connection and encountered error support
/// retryability. See the documentation
/// [here](https://docs.mongodb.com/manual/core/retryable-writes/) for more information on
/// retryable writes.


This operation will retry once upon failure if the connection and encountered error support
retryability. See the documentation
[here] for more information on
retryable writes.
This operation will retry once upon failure if the connection and encountered error support retryability . See the documentation [ here ] for more information on retryable writes .
pub fn find_one_and_replace_with_session(
        &self,
        filter: Document,
        replacement: T,
        options: impl Into<Option<FindOneAndReplaceOptions>>,
        session: &mut ClientSession,
    ) -> Result<Option<T>> {
        RUNTIME.block_on(self.async_collection.find_one_and_replace_with_session(
            filter,
            replacement,
            options.into(),
            &mut session.async_client_session,
        ))
    }
pub fn find_one_and_replace_with_session ( & self , filter : Document , replacement : T , options : impl Into < Option < FindOneAndReplaceOptions > > , session : & mut ClientSession , ) -> Result < Option < T > > { RUNTIME . block_on ( self . async_collection . find_one_and_replace_with_session ( filter , replacement , options . into ( ) , & mut session . async_client_session , ) ) }
Atomically finds up to one document in the collection matching `filter` and replaces it with
`replacement` using the provided `ClientSession`.
Atomically finds up to one document in the collection matching ` filter ` and replaces it with ` replacement ` using the provided ` ClientSession ` .
&self
filter
Document
replacement
T
options
impl Into<Option<FindOneAndReplaceOptions>>
session
&mut ClientSession