MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017
2018-02-14T13:33:47.147+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017 after 5000ms milliseconds, giving up.
2018-02-14T13:33:47.148+0800 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed :
exception: connect failed
How to fix:
Occurred this error because you did not open the MongoDB server.
Open MongoDB server: mongod –dbpath “your MongoDB data folder path”
In my situation, just type: mongod –dbpath “D:\MongoDB\Server\3.6\data”
Hope this is helpful to you. If you have any questions, please comment it. I will reply you as soon as possible.