/* `mongoose.connect` is used to establish a connection to a MongoDB database, while `mongoose.connection` provides access to the active connection and allows you to interact with the database through events and operations. */ // see all the methods (https://mongoosejs.com/docs/api/connection.html) const database = mongoose.connection; // dbname database.useDb("users"); // collection name const collection = database.collection("users");