Not able to connect mongodb from host machine

I am not able to connect to MongoDB using below command-

mongo --host


vagrant ssh

Many reasons might prevent you to be able to do it the way you try to do it. The ssh way is the recommended way.

Earlier, I was able to connect mongoDB in the guest machine.

Now I am able to connect from host machine using below command.
mongo --host localhost:27017