I am using mongoimport to import json file to MongoDB Cloud Atlas but below command returned timeout error. What is wrong with my command?
mongoimport -u=foo -p=bar mongodb://clustersandbox-shard-00-01.wudsw.mongodb.net:27017 -d=foobar --type=json -c=users --drop --file=users.metadata.json
Error message:
2021-07-24T23:48:00.709+0800 error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: clustersandbox-shard-00-01.wudsw.mongodb.net:27017, Type: Unknown, Last error: connection() error occured during connection handshake: connection(clustersandbox-shard-00-01.wudsw.mongodb.net:27017[-64]) socket was unexpectedly closed: EOF }, ] }
I have whitelisted my IP address.