Indexes
Mongoose에서 인덱스를 선언하는 방법은 2가지가 있다. path level(또는 field level)에서 정의하는 법과 schema level에서 정의하는 법. 스키마를 정의하면서 field level에서 정의할 수 있고, schema정의가 끝나고 index() 메서드를 통해서 정의할 수도 있다. compound index를 만드려면 index() 메서드를 사용해야 한다. const animalSchema = new Schema({ name: String, type: String, tags: { type: [String], index: true } // field level }); animalSchema.index({ name: 1, type: -1 }); // schema level const ..
Mongoose/schemas
2020. 3. 9. 17:45
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 이중 연결리스트
- instance method
- saveUnitialized
- 맵
- Node.js
- 선형리스트
- resave
- alias
- map
- static method
- mongoose
- express-session
- Generator
- javascript
- 집합
- set
- mixin
- MongoDB
- pm2 #cluster #Javascript
- Iterator
- index
- 자료구조 #딕셔너리 #해시
- 다형성
- 다중상속
- virtuals
- query helper
- 자료구조
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함