I’ve set up my data to be stored in 2 collections, users and exercises. but when I try to get to those collections I’m getting the error that db.collection() is not a function. This doesn’t lineup with mongoDB’s documentation as far as I can tell. I just want to be able to access my data, and this all is making me despise mongodb
Here in your code you have to decide on wether you want to use mongodb or mongoose library that is build on top of mongoose which makes things a bit easier.
In your code you have created mongoose instance and tried to use mongo db methods with it which is not how you do it
If you want to use mongodb directly than create mongodb instance and use its methods to get you task done.
There is bit of difference in the way you use mongodb and mongoose library