After trying to connect to my MongoDB database while testing my code in Node.js as per usual, I received a connect ECONNREFUSED 127.0.0.1:27017, connect ECONNREFUSED ::1:27017 error message in console. When opening MongoDB Compass and trying to connect to it there, I also got the same message.
When looking at solutions online, one of them said to try going to C:\Program Files\MongoDB\Server\8.0\bin and there run the mongod.exe. Which worked and I could connect to my database, however 1. it only works after manually doing this process, and only until the mongod.exe console is kept open, even though before I needed neither of these things and more importantly 2. my whole database seems wiped?? Only the original admin, local, and config databases are there.
What's going on? The day before I turned off the computer forcefully with the power button after Excel froze on me, does that have to do anything with this? I have no other idea, what could have happened. Can I recover my database or do I need to load in all the data again?