I use pymongo to implement mongo database. I am trying to use the sessions and transactions for the management of operations, but I encountered this error:
pymongo.errors.OperationFailure: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
I tried this solution but without result:
myclient = pymongo.MongoClient("mongodb://localhost:27017/", retryWrites=False)
db = myclient["mydb"]
session = myclient.start_session()
Any help, thanks
You need to run with the full connection string
myclient = pymongo.MongoClient("mongodb://localhost:27017/&retryWrites=false")
or specify all parameters
myclient = pymongo.MongoClient(host="localhost", port=27017, retryWrites=False)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With