C:\Program Files\MongoDB\Server\3.2\bin>mongoimport --host cluster0.******.mong
odb.net --port 27017 --username gofood --password **** --authenticationData
base admin --db ******** --collection food_items --file C:\Users\xyz\Downl
oads\foodData2.json
2024-02-15T19:47:51.769+0530 [........................] gofoodmern.food_items
0B/6.12KB (0.0%)
2024-02-15T19:47:52.279+0530 [........................] gofoodmern.food_items
0B/6.12KB (0.0%)
2024-02-15T19:47:52.279+0530 Failed: error connecting to db server: no reacha
ble servers
2024-02-15T19:47:52.280+0530 imported 0 documents
#Is this error because of mongoDB 3.2.21 or something other issue?
4 messages · Page 1 of 1 (latest)
No mongodb experts here?
Not terribly certain on the error, it looks like you might be using the node mongo driver or the mongo cli to connect. But it looks like the server either doesn't exist (according to the error) or some improper credentials were passed. You might have better luck finding out on the mongo server... here is an invite link for that https://discord.com/invite/mongodb-714857985389625415.
I also found an article about the --host flag. Apparently you need to tell mongo that your machine is the host.
--host=127.0.0.1 seems to solve it in some cases. Other than that, I'm out of ideas. Hope you find what you need.