strapi-docker icon indicating copy to clipboard operation
strapi-docker copied to clipboard

Support MongoDB Atlas URI

Open saurabhperiwal opened this issue 5 years ago • 2 comments

I am trying to connect strapi docker image to MongoDB atlas, but everytime I try connecting it throws error "Could not connect."

saurabhperiwal avatar Nov 26 '20 14:11 saurabhperiwal

Been there just yesterday. Check this: https://strapi.io/documentation/v3.x/guides/databases.html#install-on-atlas-mongodb-atlas

wrzlbrmft avatar Nov 27 '20 06:11 wrzlbrmft

Hello,

Could you consider the possibility to generate a new database config (MongoDB) with uri information in order to take into account replicaSet, SSL, ... during first install ?

module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'mongoose',
      settings: {
        uri: "mongodb://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>?ssl=<SSL>&replicaSet=<REPLICASET>"
      },
      options: {
      },
    },
  },
});

Thanks in advance for your help.

ronny35 avatar Mar 10 '21 12:03 ronny35