Note: if you encounter an error saying the mongo shell version is not supported. You may be able to specify the version of your mongo shell in the emulator command line argument. You can refer to CosmosDB emulator windows arguments to find out all the supported mongo shell versions.
Connecting to local Mongo DB server
Make sure Mongo DB has been installed as a service or else has been started manually, for example (Windows):