Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

connect mongodb using mongoose in node js

const mongoose=require('mongoose');
const mongoURI="mongodb://localhost:27017/inotebook"


const connectToMongo=()=>
{
    mongoose.connect(mongoURI,()=>
    {
        console.log("connect Successfully");
    })
}

module.exports=connectToMongo;
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #connect #mongodb #mongoose #node #js
ADD COMMENT
Topic
Name
6+5 =