Answers for "mongoose.connect dbname"

0

mongoose connect to mongodb

// local conecation

const mongoose = require("mongoose");

mongoose
  .connect("mongodb://localhost:27017/testdb")
  .then(() => console.log("Connected to MongoDB..."))
  .catch((err) => console.error("Could not connect to MongoDB...", err));
Posted by: Guest on November-13-2021
9

Mongoose db connect

mongoose.connect('mongodb://username:password@host:port/database?options...', {useNewUrlParser: true});
Posted by: Guest on July-09-2020

Code answers related to "mongoose.connect dbname"

Browse Popular Code Answers by Language