/// Starts a new transaction on this session with the given `TransactionOptions`. If no options
/// are provided, the session's `defaultTransactionOptions` will be used. This session must
/// be passed into each operation within the transaction; otherwise, the operation will be
/// executed outside of the transaction.
///
/// ```rust
/// # use mongodb::{bson::{doc, Document}, error::Result, sync::{Client, ClientSession}};
/// #
/// # async fn do_stuff() -> Result<()> {
/// # let client = Client::with_uri_str("mongodb://example.com")?;
/// # let coll = client.database("foo").collection::<Document>("bar");
/// # let mut session = client.start_session(None)?;
/// session.start_transaction(None)?;
/// let result = coll.insert_one_with_session(doc! { "x": 1 }, None, &mut session)?;
/// session.commit_transaction()?;
/// # Ok(())
/// # }
/// ```
Starts a new transaction on this session with the given `TransactionOptions`. If no options
are provided, the session's `defaultTransactionOptions` will be used. This session must
be passed into each operation within the transaction; otherwise, the operation will be
executed outside of the transaction.


Starts a new transaction on this session with the given ` TransactionOptions ` . If no options are provided the session ' s ` defaultTransactionOptions ` will be used . This session must be passed into each operation within the transaction ; otherwise the operation will be executed outside of the transaction .
pub fn start_transaction(
        &mut self,
        options: impl Into<Option<TransactionOptions>>,
    ) -> Result<()> {
        RUNTIME.block_on(self.async_client_session.start_transaction(options))
    }
pub fn start_transaction ( & mut self , options : impl Into < Option < TransactionOptions > > , ) -> Result < ( ) > { RUNTIME . block_on ( self . async_client_session . start_transaction ( options ) ) }
Starts a new transaction on this session with the given `TransactionOptions`.
Starts a new transaction on this session with the given ` TransactionOptions ` .
&mut self
options
impl Into<Option<TransactionOptions>>
use mongodb::{bson::{doc, document}, error::result, sync::{client, clientsession}};
None
async fn do_stuff() -> result<()> {
None
let client = client::with_uri_str("mongodb://example.com")?;
None
let coll = client.database("foo").collection::<document>("bar");
None
let mut session = client.start_session(none)?;
session.start_transaction(None)?;
let result = coll.insert_one_with_session(doc. { "x": 1 }, None, &mut session)?;
session.commit_transaction()?.
session . start_transaction ( None ) ? ; let result = coll . insert_one_with_session ( doc . { " x " : 1 } None &mut session ) ? ; session . commit_transaction () ? .
ok(())
None
}
None