일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- react-native
- instance
- Express
- iIntelliJ
- MEAN stack
- memory structure
- API테스트
- Mongo
- window
- Git
- OOP
- MaridDB
- pbkdf2-password
- 다중 서버 명령
- centos
- Android
- rest-assured
- Modulization
- elemMatch
- multidex
- Java
- PBKDF2
- event-driven
- node
- 64k method
- Linux
- Mongoose
- proguard
- Setup
- ssh key
- Today
- Total
목록Mongoose (2)
천줄코딩도 한 걸음부터
// mongodb setup var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/mydb'); var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function() { // we're connected! console.log('connected successfully'); }); 다음과 같은 Warning이 발생함(node:1876) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()..
1. npm을 통해 mongoose 모듈 설치 npm install mongoose 2. 자바스크립트 작성 connection-test.jsvar mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/mydb'); var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function() { // we're connected! console.log('connected successfully'); }); 3. 실행 node connection-test.js