Old collections not showing up after creating new /data/db

I am new to mongodb, but I’m working on a project which was using mongo and had created a large collection with a large number of documents. I was able to work with it no problem.

Today when I tried to start mongod I got the following error -

{"t":{"$date":"2024-11-01T15:29:16.827-07:00"},"s":"E",  "c":"CONTROL",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."}}

I looked and /data/db didn’t exist, so I created it.
Now I was able to start mongod, but the old collection I was working with is not showing up.

How can I fix this? It was 100s of GBs of collected data, did I lose it?

If you had to create /data/db then your old database was most likely stored elsewhere.

It is impossible for us to know where it is.

It is impossible for us to know if you lost it.