MongoDB Atlas Error while performing transaction on multiple collections (code 8000)

I had this same issue and could not solve it. I ended up creating a new cluster on Azure (instead of AWS) and it seems to be working fine.

Not sure if this is an issue with their implementation on AWS or case by case mis-configuration

Update: The same error is now happening on the new cluster. I raised a ticket and got the following response;

This has been determined to be a bug currently affecting the M0 free cluster and shared tiers of Atlas (M2 and M5). We have opened an internal bug report to address this. While the internal development queue for our Cloud products is not publicly visible, we are tracking the work required to make multi-document transactions work on Atlas free tier clusters.

They said the same thing as the other answer. Please use M10. However, M10 is about $60/m which is not quite a resolution by any means. It also completely invalidates the main selling point of them saying M0 now includes MongoDb 4.0


As mentioned in comments, according to MongoDB team this issue has been solved on version 4.0.5

I've tested the same code posted on my question and it now works fine.

For anyone facing the same issue, make sure to be using a version equal to or higher than 4.0.5.