[참고자료] What is the "__v" field in Mongoose I'm using Mongoose version 3 with MongoDB version 2.2. I've noticed a __v field has started appearing in my MongoDB documents. Is it something to do with versioning? How is it used? stackoverflow.com Mongoose v6.5.4: Schemas If you haven't yet done so, please take a minute to read the quickstart to get an idea of how Mongoose works. If you are migrating..
[참고자료] $in — MongoDB Manual Docs Home → MongoDB Manual $inThe $in operator selects the documents where the value of a field equals any value in the specified array. To specify an $in expression, use the following prototype:{ field: { $in: [ , , ... ] } }For comparison of different www.mongodb.com $exists — MongoDB Manual Docs Home → MongoDB Manual $existsSyntax: { field: { $exists: } }When is tr..
객체안에 메소드 정의할 때는 mongoose모듈을 불러와서 mongoose.methods 로 했습니다. mongoose의 Schema 내부 타입스크립트 코드를 한번 뜯어보니까 method 도 있다는걸 알게됐습니다. mongoose.method 와 mongoose.methods 의 용도와 의미가 무엇인지 알아보기로 했습니다. (1) mongoose.method 소스를 깠을 때는 의미는 다음과 같습니다. Adds an instance method to documents constructed from Models compiled from this schema. 이 스키마에서 컴파일된 모델로 작성된 문서에 인스턴스 메서드를 추가 합니다. (2) mongoose.methods Object of currently ..
[참고자료] [mongodb] mongo 콘솔에서 ObjectId로 객체를 어떻게 검색합니까? - 리뷰나라 이 질문에 C # 및 Perl에 대한 답변이 있지만 기본 인터페이스에는 해당되지 않습니다. 나는 이것이 효과가 있다고 생각했다. db.theColl.find( { _id: ObjectId("4ecbe7f9e8c1c9092c000027") } ) 쿼리에서 결과가 반 daplus.net find(_id: "아이디값") 형식으로 하니까 검색결과에 아무것도 안뜹니다. 자세히 확인해보니 몽고디비의 콜렉션안의 데이터의 구분자인 _id컬럼의 타입은 ObjectId 객체 입니다. _id 를 기준으로 데이터를 검색할 때는 아래와 같이 하면 됩니다. find({ _id: ObjectId("") })
[문제사항] const mongoose = require('mongoose') mongoose.connect('클러스터 url', { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false, }).then(() => console.log('MongoDB Connected...')).catch( err => console.log(err)) 몽구스 패키지를 설치하고 연결하고 프로젝트를 실행시켜봤는데 에러로그를 출력하면서 프로젝트 코드를 실행됩니다. > start > node app.js Example app listening on port 3000 MongoParseError: options u..
- Total
- Today
- Yesterday
- 클린아키텍쳐
- OS
- vscode
- node.js
- 습관개선
- MySQL
- Mongoose
- TypeScript
- Jekyll
- MongoDB
- nestjs
- 디지털디톡스
- 바이트디그리
- Nest.js
- 개발용어
- 한달독서
- gem
- 한달어스
- 갓생살자
- 미완
- 스마트폰중독
- TDD
- IT용어
- 나도 할 수 있다
- RDBMS
- 참고
- jest
- git
- typeORM
- nestjs jest
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |