I was doing a mongodb tutorial and now all of a sudden I cannot connect. I have tried all sorts of things and nothing is working. when I copy and paste the string from the cluster (which worked 3 hours ago) it says
QUERY [js] Error: couldn't connect to server .:27017, connection attempt failed: HostNotFound: Could not find address for .:27017: SocketException: Host not found (authoritative) :
so I did some googling and found all kinds of stuff about mongod. so when I type in mongod it fails because there is no /data/db folder. so I followed the top answer from here to create the directory. it says the directory still does not exist. I am looking in my finder and that folder does in fact exist. so I'm not sure what's happening there.
I tried mongod --port 27018
but it fails because
exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
but again that folder exists. I am looking at it. it currently contains a txtfile called 'you_stupid_fucking_dumbass_computer_why_cant_you_see_this.txt'. according to the terminal, that file does indeed exist in the /data/db folder which exists exactly where I created it as directed in the hyperlink. I used the accepted answer. not sure why it' failing.
I have been searching all over stack overflow and have tried all variety of answers to no effect. if you are going to recommend anything that involves homebrew, just know that any homebrew command fails because it cannot recognize 'services'. I have tried them all but have found no luck. I tried killing by the pid but that didn't work either because no matching processes
are found. I have tried various 'killall' things too and none of them work. same reason. command isn't recognized. so there's that too. please help