Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2895

Atlas connection string question

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS Windows 10
      MongoDB shell version v3.6.5
      MongoDB server version: 3.6.5

      I've created Atlas M0 (Free Tier) cluster. (screen)

      I want to add db with info to this cluster.  When I tried to connect to tier cluster via driver3.6 or later and wrote mongodb+srv://user:<PASSWORD>@cluster0-ox90k.mongodb.net/test?retryWrites=true, I always get an error: Connection strings must start with 'mongodb://'.

      Okay, I deleted the snippet +srv and wrote the same way mongodb://user:<PASSWORD>@cluster0-ox90k.mongodb.net/test?retryWrites=true and was unable to connect.

      So, I finally solved it via driver 3.4 or earlier, I wrote mongodb://user:<PASSWORD>@cluster0-shard-00-00-ox90k.mongodb.net:27017,cluster0-shard-00-01-ox90k.mongodb.net:27017,cluster0-shard-00-02-ox90k.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true

      Why did I solve it only via 3.4 driver?
      Here's my detail question with solution too - https://stackoverflow.com/questions/50916467/how-to-connect-to-atlas-m0-free-tier-cluster-correctly-via-java-driver
      https://university.mongodb.com/courses/M001/2018_June/discussion/forum/threads/5b2bf4f7be6a833aaf23e399
      Same issue was probably here - http://discourse.metabase.com/t/connect-to-mongodb/3597

        1. 100.png
          100.png
          39 kB
        2. 101.png
          101.png
          17 kB

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            romax300@ukr.net Max R
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: