Hi Nikolay,
SO suggests replica set https://stackoverflow.com/questions/50255195/how-to-configure-a-mongodb-cluster-which-supports-sessions, but i think it should work with single instance.
As mentioned in the SO answer and the Transactions page, multi document transactions are not supported in a non replica set deployment since the feature depends on the existence of the oplog. This is by design, and there is no “workaround” to make transactions work with a standalone deployment.
If you need a testing deployment, you can create a single-node replica set by starting the mongod with the replSet parameter, initiate the set using that one node, and don’t add any more node to the set. For testing purposes, single node replica set is fine, although it’s strongly not recommended to run any kind of production work on this setup.
Best regards,
Kevin