I followed the steps but it says connect failed.
If you cannot connect with SocketException then the most likely cause is that no server is running at the given address.
Since your configuration file does not specify any process management option and that you do not have any other open terminal, I suspect that you did not start mongod. If you did, then it failed to start or is listening on some other port.
I hope you found @steevej-1495’s response helpful. Let us know if you are still facing any issues.
You were right (as usual) Steevej-1495. I did not start mongod.