MongoDB CRUD Operation Manual
MongoDB CRUD Operations - MongoDB Manual v7.0
CRUD operations create, read, update, and delete documents.You can connect with driver methods and perform CRUD operations for deployments hosted in the following environments:Create or insert operations add new documents to a collection. If the collection
www.mongodb.com
MongoDB CRUD의 핵심은 Query Filter와 Operator
1. 가장 기본적인 형태의 MQL
2. Query Filter와 Operator를 적용한 MQL
- query criteria 부분이 query filter.
- $gt가 operator.
- 즉, query criteria는 SQL의 where 절과 같고, operator는 like % 문법 등과 같다.
- projection은 보고싶은 field를 선택한다. 1은 true, 0은 false를 의미한다
- 위의 예시를 해석하면, 조회 결과 Document에서 name, address field만 보겠다는 뜻이다
- SQL로 하면 다음과 같다. select name, address from users ...
- https://www.mongodb.com/docs/v7.0/tutorial/project-fields-from-query-results/#return-all-fields-in-matching-documents
Operator 공식 문서
Operators - MongoDB Manual v7.0
To learn which operators are unsupported in MongoDB Atlas, see Unsupported Commands in Atlas.Query and Projection OperatorsQuery operators provide ways to locate data within the database and projection operators modify how data is presented.Update Operator
www.mongodb.com
- Operator의 종류가 매우 많다. 자주 사용하는건 일부 정해져 있고, 필요한 건 문서를 확인하면서 사용한다.
'Back-End > MongoDB' 카테고리의 다른 글
[MongoDB] MQL 기초 4 - 배열과 내장 Document를 다루는 방법 1 (Read) (0) | 2024.05.31 |
---|---|
[MongoDB] MQL 기초 3 - 유용한 CRUD 쿼리 함수 (0) | 2024.05.31 |
[MongoDB] MQL 기초 2 - 기본 CRUD (0) | 2024.05.31 |
[MongoDB] SQL vs MQL 비교 문서 (0) | 2024.05.31 |
[MongoDB] Replica Set Local에 구축하기 (0) | 2024.05.31 |