- Reference >
- Database Commands >
- Sessions Commands >
- abortTransaction
abortTransaction¶
On this page
Definition¶
-
abortTransaction¶ New in version 4.0.
Terminates the multi-document transaction and rolls back any data changes made by the operations within the transaction. That is, the transaction ends without saving any of the changes made by the operations in the transaction.
To run the
abortTransaction, the command must be run against theadmindatabase and run within aSession. Rather than run theabortTransactioncommand directly, most users should use the driver method or themongoshellSession.abortTransaction()helper.The command has the following syntax: