Hello I can't connect with short SRV string and can't load data with mongorestore

when I try to connect with short SRV string I can’t connect but with standard connection string I can, but when I try to load data with mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password<YOUR_CLUSTER_URI> data I get an Error parsing command line options: error parsing uri. Please Help

Is the following the string you pass to mongo?

Hello @Annameret_29321,

You should pass that URI string as below mentioned format

mongodb+srv://m220student:m220password@<SHORT-SRV-URL = CLUSTER URL>

e.g mongodb+srv://m220student:m220password@abcdefgh.mongodb.net/xyz

1 Like

Yes and I get an error, but I can access through standard string

Hello, I try to use short srv string to access but always I get an error, then I try to access through standard string and I accessed

this is need for load data to my cluster, Please give some advice

and viraj_thakrar in the shell when I copied the short srv string there another one, mongodb_srv://abcdefgh.mongodb.net/xyz --username m220student

Yes if you write that inside your shell, than you can connect to your MongoDB Atlas instance. You will be asked for password once you hit enter that URL in shell.

@Annameret_29321, your problem probably comes from the fact that you are not using a valid URI.

mongodb_srv://abcdefgh.mongodb.net/xyz is not a valid URI
mongodb+srv://m220student:m220password<YOUR_CLUSTER_URI> is not a valid URI

As @viraj_thakrar wrote a URI is in the format mongodb+srv://m220student:m220password@abcdefgh.mongodb.net/xyz. And for this course in particular, if you followed the instruction to create a specific mflix cluster, your URI should look like mongodb+srv://m220student:m220password@mflix-abc12.mongodb.net. And just to be clear, abc12 has to be replaced with letters and digits from your own URI.

this is what I get after that

but with standard string I can access

I think that with the SRV string you should not use --username and --password options. That’s why all the examples proposed show the URI of the form …//m220student:m220password@mflix-…. You should try the proposed form to see if it works.

Hi, this is what I geter

steevej-1495, do you know how to load data through standard string

Yes and you do too with https://docs.mongodb.com/manual/reference/program/mongorestore/

Hi, Thanks for trying to help, but I can’t connect through that

Hi all, I got exactly the same problem. The normal shell command works as expected, but the mongorestore fails with the error “error parsing uri” and “cannot unmarshal DNS message”. Attached image for more clarity.

The manual for mongorestore is:

Verify you use the correct syntax for the version you are using.