Lab1.1getting error while importing people.json

C:\Users\DAS>mongoimport --db test --collection inventory --authenticationDatabase admin --username m201student --password m201password --drop --file Downloads\people.json
2019-08-22T15:23:56.462+0100 […] test.inventory 0B/21.8MB (0.0%)
2019-08-22T15:23:59.463+0100 […] test.inventory 0B/21.8MB (0.0%)
2019-08-22T15:24:00.974+0100 […] test.inventory 0B/21.8MB (0.0%)
2019-08-22T15:24:00.974+0100 Failed: error connecting to db server: no reachable servers
2019-08-22T15:24:00.975+0100 imported 0 documents

Hey @baishakhi_81883

There appears to be no mongod process started.

So unless you are running a mongod process on your local machine on port 27017 you will need to include the --host argument in the mongoimport command.

Or just start a mongod process locally and try again.

Please follow the instructions.

After you’ve successfully installed MongoDB you should start a standalone server. Once your server is up and running you should be able to download the people.json handout and import it with mongoimport. Make sure to import the documents into the m201 database and the people collection.

And the docs for installing and running on windows
https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-windows/#install-mongodb-enterprise-edition-on-windows

Hi @natac13
Yes i have tried to use --host = 127.0.0.1 still it was giving error ,that’s why i asked on the forum.#Also i started the mongod process by following command
“C:\Program Files\MongoDB\Server\4.0\bin\mongo.exe” but it is not connecting
then i tried to connect through mongoshell after adding connection string from atlas cluster.this connection was successful,so i used mongoimport after that but not successful

Please help me how to start the standalone server

First it should be

--host=127.0.0.1
#or
-- host 127.0.0.1

Also did you install MongoDB as a Service or just binary, Im guessing binary therefore:
Second to start the daemon process the command I believe is. Notice mongod not mongo

"C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe" --dbpath="c:\data\db"

You should see

[initandlisten] waiting for connections

Please follow the steps in the documents
https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-windows/#start-mdb-edition-from-the-command-interpreter

mongoimport should be executed outside of mongo shell . Execute the below command from command prompt [not mongo shell]

for example
mongoimport --db testdb --collection mytable --file “D:\Emp.json”