286 — ChangeStreamHistoryLost
transactionconfiguration
This operation is not supported inside a multi-document transaction
What is happening?
OperationNotSupportedInTransaction is returned when an operation that cannot run inside a multi-document transaction is attempted within one. MongoDB transactions support most CRUD operations, but certain operations like creating collections, creating indexes, DDL commands, and some administrative commands are not allowed inside transactions.
Common causes
- Attempting to create a collection inside a transaction
- Running createIndex or dropIndex inside a transaction
- Using $out or $merge aggregation stages inside a transaction
- Executing administrative commands (listCollections, dbStats) inside a transaction
- Calling count() inside a transaction (use countDocuments() or an aggregation instead)