Importing data failed

Hi,
I’m unable to import data, but able to connect using mongo shell and compass.
I’m getting Access Denied error as following.

D:\Learning\mongodb\m220\mflix-java\mflix>mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@mflix-prpg5.mongodb.net/test?retryWrites=true&w=majority> data
2019-06-23T20:28:43.415+0530 WARNING: ignoring unsupported URI parameter ‘retrywrites’
2019-06-23T20:28:48.788+0530 using default ‘dump’ directory
2019-06-23T20:28:48.789+0530 see mongorestore --help for usage information
2019-06-23T20:28:48.792+0530 Failed: mongorestore target ‘dump’ invalid: FindFirstFile dump: The system cannot find the file specified.
Access is denied.

Thanks

The correct format is

mongorestore --drop --gzip --uri “mongodb+srv://username:password@YOUR_CLUSTER_URI/test” data

Try this way
mongorestore --drop --gzip --uri “mongodb+srv://m220student:m220password@mflix-prpg5.mongodb.net/test?retryWrites=true&w=majority” data

2 Likes

Thank you!
Its worked for me.

1 Like