zernzern1993
zernzern1993

Reputation: 265

MongoDB deployment does not support retryable writes

Hi I am facing this issue while working with transactions locally... I have added retryWrites to false in my connection string as below:-

mongodb://127.0.0.1:27017/project_name?retryWrites=false

I restarted my servers but I still hit the same issue "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string."

Upvotes: 2

Views: 5924

Answers (1)

wak786
wak786

Reputation: 1615

By looking at connection string it seems that you are using standalone server. Just try with this mongodb://127.0.0.1:27017/project_name

For using retryWritesyou need to have some pre conditions:

  • Retryable writes require a replica set or sharded cluster, and do not support standalone instances.

  • Retryable writes require a storage engine supporting document-level locking, such as the WiredTiger or in-memory storage engines.

  • The MongoDB version of every node in the cluster must be 3.6 or greater, and the featureCompatibilityVersion of each node in the cluster must be 3.6 or greater. See setFeatureCompatibilityVersion for more information on the featureCompatibilityVersion flag.

Retryable Writes

Upvotes: 2

Related Questions