Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :

praneypareek@Praneys-MacBook-Pro ~ % mongo

MongoDB shell version v4.4.3

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :

connect@src/mongo/shell/mongo.js:374:17

@(connect):2:6

exception: connect failed

exiting with code 1

Welcome to the community!

Is your mongod up and running on port 27017?
Check ps -ef|grep mongod

You can connect only when it is up

Since you are taking the M001, I suspect that you should be using the IDE to connect. In addition you in M001, you are supposed to connect to an Atlas cluster.

Verify the steps required by the quiz or lab.