//npm i mongoose --s
const mongoose = require('mongoose');
mongoose.connect('mongodb+srv://<user>:<password>@<userid>.l124826e.mongodb.net/<dbname>?retryWrites=true&w=mahjejodsghjkrity',{
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false
}).then(()=>{
console.log('MongDB Connected')
}).catch(err =>{
console.log(err)
})
'basic > Node.js' 카테고리의 다른 글
[몽고DB] 연결하기 (0) | 2021.01.04 |
---|---|
[Node.js] jQuery로 ajax 활용 (0) | 2020.11.11 |
[Node.js] Ajax (0) | 2020.10.30 |
[Node.js] 나만의 Module만들기 (0) | 2020.10.29 |
[Node.js] Session (0) | 2020.10.29 |