MongoDB collection isn't working (exercise tracker

Tell us what’s happening:

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

Your code so far
Link to Repl!

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Exercise Tracker

Link to the challenge:

hi @sbrevolution5,

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

Thanks so much, I thought they were able to be used interchangeably! The lessons did not make it very clear!