Problems with mongorestore

I am trouble executing the mongorestore command to populate the database.
Following is the command and error message:
(mflix) C:\Users\jtgajda\Desktop\m220p\2m220\mflix-python>mongorestore --drop –
gzip --uri “mongodb+srv://mflix-lmjjv.mongodb.net/test --username m220student –
password m220password” data
2018-11-20T16:49:38.382-0500 preparing collections to restore from
2018-11-20T16:49:38.444-0500 Failed: mflix.movies: error reading database: us
er is not allowed to do action [listCollections] on [mflix.]

I have created the m220student with the following role:
|* readWriteAnyDatabase @admin

Any help would be appreciated!
Thanks in advance.

Hi Jeff_77528,

Try including user credentials into the uri text (double quotes) not using --username --password:

mongorestore --drop –-gzip --uri “mongodb+srv://m220student:m220password@mflix-lmjjv.mongodb.net/test” data

Regards,
Antonio

4 Likes

Antonio,

This worked. Thank you very much for your help!

Regards,
Jeff

Now it is working fine, Thanks Antonio

I tried to restore and it keeps giving me an error message

error parsing command line options: error parsing uri (mongodb+srv://m220student:m220password@mflix-zdi3e.mongodb.net/test): scheme must be “mongodb”.

Any suggestions please?

May be it is an old version that does not understand the +srv.

thanks a lot man. it really helped