muety / anchr

⚓️ Anchr provides you with a toolbox for tiny tasks on the internet, especially bookmark collections
https://anchr.io
GNU General Public License v3.0
269 stars 26 forks source link

Fix docker-compose problem with mongodb #69

Closed amixsty closed 7 months ago

amixsty commented 7 months ago

When we use mongo:3.4 we got this error:

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.

muety commented 7 months ago

Great contribution, thanks a lot! :raised_hands:

amixsty commented 7 months ago

A special thanks to my colleague Mr.@tuxitop for helping me to fix this.