MongoTransactionError

Node.jsMongoAPIErrortransaction

An error related to multi-document transaction usage

What is happening?

MongoTransactionError indicates incorrect usage of the transaction API — such as running operations on a transaction that has already been committed or aborted, or attempting transactions on a topology that doesn't support them (standalone).

Common causes

  1. Running operations after commitTransaction or abortTransaction
  2. Starting a transaction on a standalone server (requires replica set)
  3. Attempting nested transactions (not supported)
  4. Session already has an active transaction

Diagnostic Steps