When I put app.listen(5000) inside the anonymous function within mongodb.connect(), I dont get any connectivity to my site at all if I run node db.js in the terminal. But if I put app.listen(5000) back inside the app.js file, my site works.
But the whole point is to connect to the database first which is why I want it inside of the connect() function on my db.js file.
Sorry if I am not explaining this well, I hope this makes sense.
This release removes support for callbacks in favor of a promise-based API. The following list provides some strategies for callback users to adopt this version: