Way to Create transaction in strapi

I want to create a transaction in which I create a document in one collection and then create another document in a different collection when the first succeeds. If the first fails, the second should not happen, and vice versa.

I noticed that mongoose supports transactions. However, I am unable to do so in Strapi because I am unable to access the DB connection in order to construct a session for beginning transactions.

1 Like

I would recommend having a look at this issue previously created;

Yes, I saw it but the solution seems to be only SQL specific. I am working with mongoDB