What is a TransientTransactionError in Mongoose (or MongoDB)?

前端 未结 16 1724
庸人自扰
庸人自扰 2020-11-27 07:36

I have server.js and db.js The db.js file interacts with my database using Mongoose and I use server.js to call functions

相关标签:
16条回答
  • 2020-11-27 07:55

    I had

      'MongoNetworkError',
      errorLabels: [ 'TransientTransactionError' ],
      [Symbol(mongoErrorContextSymbol)]:
    

    I added my current IP to whiteList following "main page > security section > network access > add IP" in MongoDB website.

    I hope this helps.

    0 讨论(0)
  • 2020-11-27 07:55

    Using mLab -- When your cluster is created, you need to add a database user (under the users tab) and make sure to not click the Make read-only checkbox. Once I did this, the errors went away. I was getting the same errors as above. The database user can be your login user name and password.

    0 讨论(0)
  • 2020-11-27 08:00

    If you still have this error, another reason is that you forgot to restart nodemon server after changing config file. CTRL+C and start again, that's how i solved it.

    0 讨论(0)
  • 2020-11-27 08:01

    Security > Network Acess> Add IP Adress > Add Current Computer IP address. Solved my problem.

    0 讨论(0)
  • 2020-11-27 08:03

    For me, the transient transaction error came whenever I switched from my wifi network to my phone's hotspot. If this happens to you too, go to MongoDB website where you have made your database and white list your current IP address again. This will solve your problem.

    0 讨论(0)
  • 2020-11-27 08:04

    Go to your MongoDb Atlas dashboard. Click on Network Access, Click on add Ip Address and allow connectivity from any Ip Address. This should solve your problem.

    0 讨论(0)
提交回复
热议问题