Answers for "mongoose.js"

6

mongoose

const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost:27017/testDB', 
	{
	 useNewUrlParser: true,
	 useUnifiedTopology: true,
	 useCreateIndex: true,
	 useFindAndModify: false
	})
.then(()=>{
	console.log('connected');
	})
.catch((e)=>{
	console.log("Something went wrong", e);
	})
Posted by: Guest on July-14-2021

Browse Popular Code Answers by Language