MongoError: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string

前端 未结 4 613
逝去的感伤
逝去的感伤 2021-01-03 22:05

I am using \"mongoose\": \"^5.7.1\" in my Node.js project. I am making an api which involves updating in two documents. So, I am using the transactions like fol

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-03 22:31

    Please try adding &retryWrites=false to your connection string

    --

    I actually got the errors mentioned in the OP when connecting to our remote db server, whereas it was working locally. I contacted our mongo hosted support before trying the suggestion that is in the error.

    --

    This is what our hosted mongo site (mLab) said :

    It's likely your app's driver was updated to a more recent version which is attempting to use a WiredTiger-only feature. As the error mentions, you'll need to add &retryWrites=false to your connection string.

    https://docs.mlab.com/faq/#why-am-i-getting-the-transaction-numbers-are-only-allowed-on-storage-engines-that-support-document-level-locking-error

提交回复
热议问题