/// Replaces up to one document matching `query` in the collection 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 replace_one_with_session(
        &self,
        query: Document,
        replacement: impl Borrow<T>,
        options: impl Into<Option<ReplaceOptions>>,
        session: &mut ClientSession,
    ) -> Result<UpdateResult> {
        RUNTIME.block_on(self.async_collection.replace_one_with_session(
            query,
            replacement.borrow(),
            options.into(),
            &mut session.async_client_session,
        ))
    }
pub fn replace_one_with_session ( & self , query : Document , replacement : impl Borrow < T > , options : impl Into < Option < ReplaceOptions > > , session : & mut ClientSession , ) -> Result < UpdateResult > { RUNTIME . block_on ( self . async_collection . replace_one_with_session ( query , replacement . borrow ( ) , options . into ( ) , & mut session . async_client_session , ) ) }
Replaces up to one document matching `query` in the collection with `replacement` using the
provided `ClientSession`.
Replaces up to one document matching ` query ` in the collection with ` replacement ` using the provided ` ClientSession ` .
&self
query
Document
replacement
impl Borrow<T>
options
impl Into<Option<ReplaceOptions>>
session
&mut ClientSession