I am currently trying to learn
MongoDB and I am having trouble finding a solution for this problem. When I run a
mongoimport command it I get the following error:
~ mongoimport --host localhost --port 27017 --db test --collection people --file ~/Downloads/mongodb-consultas.json --jsonArray 2015-09-27T20:46:03.228-0600 [........................] test.people 0.0 B/684.2 KB (0.0%) 2015-09-27T20:46:03.745-0600 Failed: error connecting to db server: no reachable servers 2015-09-27T20:46:03.745-0600 imported 0 documents
When I substituted
127.0.0.1 I get the following error:
~ mongoimport --host 127.0.0.1 --port 27017 --db test --collection people --file ~/Downloads/mongodb-consultas.json --jsonArray 2015-09-28T15:15:42.047-0600 connected to: 127.0.0.1:27017 2015-09-28T15:15:42.049-0600 Failed: error reading separator after document #1: bad JSON array format - found no opening bracket '[' in input source 2015-09-28T15:15:42.049-0600 imported 0 documents
The document that I am trying to import is not corrupted as I got it from a MongoDB tutorial, and it is working for other users.
My MongoDB shell version is 3.0.6.
I have a
MongoDB server by running
mongod in the command line. The command
mongo runs fine as well.
My firewall allows incoming connections for MongoDB.