If you develop against of containerized mongo instance using the official Docker Mongo image and make attempt to use transactions, you will most probably face the following error:
com.mongodb.MongoCommandException: Command failed with error 20 (IllegalOperation): 'Transaction numbers are only allowed on a replica set member or mongos' on server localhost:28017. The full response is {"ok": 0.0, "errmsg": "Transaction numbers are only allowed on a replica set member or mongos", "code": 20, "codeName": "IllegalOperation"}
This single docker-compose.yaml
will solve the problem by creating replica set out of single node.
Thanks a lot ๐