monica millad
monica millad

Reputation: 101

Transactions in typeorm with mongodb

I've a nestjs app with mongodb v4.2.2 I'm trying to run a function in a transaction by adding @Transactional() from typeorm-transactional-cls-hooked lib and I'm getting this error TypeORMError: Transactions aren't supported by MongoDB. as I know that transactions are supported in mongodb since 4.0. so typeorm is not supporting transactions for mongodb or am I missing something here?

Upvotes: 0

Views: 1662

Answers (1)

Soroush Ahrari
Soroush Ahrari

Reputation: 583

According to this issue mongodb driver does not support transactions yet. There is a failed PR that has not been updated since 2019.

Upvotes: 2

Related Questions