Error when loading data to cluster

Hi,

I tried to load the data into ckuster, but received the following error. What should be the correct uri?
Thanks!

===========command=========
:bin wendy$ ./mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@mflix-shard-00-00-iy1xw.mongodb.net/test?replicaSet=mflix-shard-0 /Users/wendy/Downloads/m220j-2019-02-12/mflix-java/mflix/data

2019-02-17T20:51:51.705-0500 error parsing command line options: error parsing uri (mongodb+srv://m220student:m220password@mflix-shard-00-00-iy1xw.mongodb.net/test?replicaSet=mflix-shard-0): lookup _mongodb._tcp.mflix-shard-00-00-iy1xw.mongodb.net on 128.6.1.1:53: no such host

The same URI that you use to connect with mongo shell. If not sure you may go back on Atlas and press the connect button and then it will show you the URI of your cluster.

Could you take a look of this --uri? I could not figure out what was wrong? Thanks!
–uri mongodb+srv://m220student:m220password@mflix-shard-00-00-iy1xw.mongodb.net/test?replicaSet=mflix-shard-0 /Users/wendy/Downloads/m220j-2019-02-12/mflix-java/mflix/data

Hi Steevej-1495,

Not sure why the URI works for connection, but failed to load. I could not figure out what was wrong. Any suggestions? Thanks!

I tried the following command and was able to connect to the database

./mongo “mongodb://mflix-shard-00-00-iy1xw.mongodb.net:27017/test?replicaSet=mflix-shard-0” --ssl --authenticationDatabase admin --username m220student --password m220password

But the following command didn’t work when trying to load the data:
./mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@mflix-shard-00-00-iy1xw.mongodb.net/test?replicaSet=mflix-shard-0 /Users/wendy/Downloads/m220j-2019-02-12/mflix-java/mflix/data

2019-02-17T20:51:51.705-0500 error parsing command line options: error parsing uri (mongodb+srv://m220student:m220password@mflix-shard-00-00-iy1xw.mongodb.net/test?replicaSet=mflix-shard-0): lookup _mongodb._tcp.mflix-shard-00-00-iy1xw.mongodb.net on 128.6.1.1:53: no such host

FYI, I fixed this issue. Thanks!

Can I know what was the fix? I am facing a similar issue

Hi,

My problem was that I used the wrong “your-atlas-uri” initially. You can find it by following the following steps:

  1. In the Atlas, select the tab of “Command Line Tools”
  2. Click “Connection Instructions”
  3. Click “Connect with MongoDB Compass”
  4. Under item 2 (Copy the URI Connection String), when I selected “I am using Compass 1.2 or later”,
    I saw my-atlas-uri (mflix-iy1xw.mongodb.net):
    mongodb+srv:// m220student : @mflix-iy1xw.mongodb.net/admin

Hope this helps! Good luck!