unable to connect to database at mongodb://anchr:123@mongo:27017/anchr
Error: unable to connect to database at mongodb://anchr:123@mongo:27017/anchr
at NativeConnection.onConnectFailed (/app/app.js:10:15)
at NativeConnection.emit (node:events:517:28)
at /app/node_modules/mongoose/lib/connection.js:764:30
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
It's because the mongoose module is updated and no longer support mongo:3.4. As the mention in README file, we have to use mongo:6.x. That's why i change it to 6.0 and change the mongo script to use mongosh instead of mongo and all of problems fixed.
When we use mongo:3.4 we got this error:
It's because the mongoose module is updated and no longer support mongo:3.4. As the mention in README file, we have to use mongo:6.x. That's why i change it to 6.0 and change the mongo script to use mongosh instead of mongo and all of problems fixed.