Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose connection

const mongoose = require("mongoose");

//  database connection with mongoose
mongoose.connect("mongodb://localhost/todos", {
        useNewUrlParser: true,
        useUnifiedTopology: true
    })
    .then(() => console.log("connection successful"))
    .catch((err) => console.log(err));
 
PREVIOUS NEXT
Tagged: #mongoose #connection
ADD COMMENT
Topic
Name
9+4 =