Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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));
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #mongoose #connect #mongodb
ADD COMMENT
Topic
Name
9+4 =