skip to Main Content

How to access one single collection in a database in MongoDB

When connecting to MongoDB with a Node.JS application using express, how do you connect to just one collection if the database has multiple collections? I have the following MONGODB_URI: MONGODB_URI=mongodb+srv://username:******@cluster0.dayw5.mongodb.net/phonebook?retryWrites=true&w=majority The database "phonebook" has three collections, "numbers", "users" and "people".…

VIEW QUESTION
Back To Top
Search