1

I'm unable to use mongoimport to load some documents to a cluster hosted by MongoDB. I followed this tutorial Load File with mongoimport and then used this command in Powershell to try and load my documents:

.\mongoimport.exe --host "mongodb://clusterads-shard-00-00-qlf9n.mongodb.net:27017,clusterads-shard-00-01-qlf9n.mongodb.net:27017,clusterads-shard-00-02-qlf9n.mongodb.net:27017/admin?replicaSet=ClusterADS-shard-0" --ssl -u <USER> -p '<PASSWORD>' --authenticationDatabase <AUTHENT> --db adscoursework --collection volcanos --drop --jsonArray --file C:\data\volErups.json

This gives the error:

[........................] adscoursework.volcanos 0B/844KB (0.0%)
[........................] adscoursework.volcanos 0B/844KB (0.0%)
Failed: error connecting to db server: no reachable servers

I can connect to the above host using Mongo Shell so I don't understand where the issue is.

Marco
3,7205 gold badges25 silver badges31 bronze badges
asked May 24, 2017 at 12:27

1 Answer 1

2

Replacing mongodb:// at the start with ClusterADS-shard-0/ (which is the replica set) and removing /admin?... made it work.

Marco
3,7205 gold badges25 silver badges31 bronze badges
answered May 24, 2017 at 13:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.