-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.js
21 lines (16 loc) · 845 Bytes
/
db.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**const MongoClient = require('mongodb').MongoClient;
const uri = "mongodb+srv://clustername:password@clustername.m3luf.gcp.mongodb.net/membership?retryWrites=true&w=majority";//cluster updated due to security
const client = new MongoClient(uri, { useNewUrlParser: true });
client.connect(err => {
// const collection = client.db("member").collection("devices");
// perform actions on the collection object
if (!err) { console.log('MongoDB Connection Succeeded.') }
else { console.log('Error in DB connection : ' + err) }
client.close();
}); */
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/test', { useNewUrlParser: true }, (err) => {
if (!err) { console.log('MongoDB Connection Succeeded.') }
else { console.log('Error in DB connection : ' + err) }
});
require ('./employee.model')