On this page本页内容
abortTransaction
¶New in version 4.0.版本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 the admin
database and run within a Session
. Rather than run the abortTransaction
command directly, most users should use the driver method or the mongo
shell Session.abortTransaction()
helper.
The command has the following syntax:语法如下所示: