What is a TransientTransactionError in Mongoose (or MongoDB)?

前端 未结 16 1781
庸人自扰
庸人自扰 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 08:11

    I encountered this error when running the populatedb.js script in the MDN tutorial for Express/NodeJS.

    The script was looking for a db connection starting with mongodb://, however my connection string from mongo started with mongodb+srv://.

    I edited the script to check for this syntax instead, which resolved the error.

    I hope this helps someone.

提交回复
热议问题