mongo-thingy icon indicating copy to clipboard operation
mongo-thingy copied to clipboard

[Feature] Support Transactions

Open candlecare opened this issue 6 years ago • 2 comments

Do you have any plan to support Transactions in mongo-thingy?

https://api.mongodb.com/python/current/api/pymongo/client_session.html#transactions

Thanks.

Sithu

candlecare avatar Oct 11 '19 05:10 candlecare

No plan yet as we still didn't switch to MongoDB 4.x, but that would be a great feature indeed!

Supposedly we just have to add a session argument in a few methods and pass it to PyMongo, which is really not much. Pull requests welcome!

ramnes avatar Oct 11 '19 09:10 ramnes

API I have in mind at the moment:

with mongo_thingy.Transaction():
    Foo.delete_one()
    Bar().save()

ramnes avatar Jan 12 '23 15:01 ramnes