I keep on trying to implement MongoDB in my code using Mongoose
, but in most of my commands that I add it in, it returns with either 'Topology was destroyed'
or 'Topology was closed'
and I can't find a way to fix the problem.
I followed along with tutorials on YT from (Worn Off keys) and changed it a bit and it didn't seem to work, and then I copied and pasted his one to see if it works but I get the same error.
Is there something I should check that I might have done wrong like in the schemas or connecting to MongoDB(even though I followed what was said in the videos) please let me know?