Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- MongoDB
- Python
- 정렬
- dfs
- nestjs
- TypeScript
- class
- 자료구조
- game
- nodejs
- AWS
- Nest.js
- react
- typeORM
- Bull
- cookie
- flask
- Sequelize
- MySQL
- mongoose
- jest
- OCR
- Dinosaur
- JavaScript
- GIT
- Queue
- Express
- 공룡게임
- 게임
Archives
- Today
- Total
목록insert (1)
포시코딩

전달 받은 값을 DB 에 저장해보자 router.post('/register', (req, res)=>{ console.log('in register post'); let id = req.body.id; let pw = req.body.pw; db.collection('login').insertOne({id: id, pw: pw}, (error, result)=>{ res.status(200).send({message: 'ajax 통신 성공 - id: ' + id + ', pw: ' + pw}); }) }) login 콜렉션 안에 insertOne 을 통해 id 와 pw 값을 집어넣는 코드 성공일 경우 error 값이 undefined 가 되고 result 값이 리턴, 실패일 경우는 그 반대로 리턴된다...
Node.js
2022. 6. 10. 15:50