Aggregation Instructions
데이터 집계 명령어
- Aggregation Operation은 여러 조건을 이용해 집합을 생성하고,
그 집합 중 필요한 값을 구하는 데 사용되는 연산을 의미한다.
- RDB의 Group By와 유사하다.
Aggregation Methods
Name
|
Description
|
Provides access to the aggregation pipeline.
|
|
Performs map-reduce aggregation for large data sets.
|
\(\texttt{aggregate}\) Instruction Prototype
db.<collection_name>.aggregate(pipeline, options)
Parameter
|
Type
|
Description
|
pipeline
(Mandatory) |
array
|
A sequence of data aggregation operations or stages.
aggregation pipeline operators 에서 보다 자세한 사항을 확인할 수 있다. The method can still accept the pipeline stages as separate arguments instead of as elements in an array; however, if you do not specify the pipeline as an array, you cannot specify the options parameter. |
options
(Optional) |
document
|
Optional. Additional options that aggregate() passes to the aggregate command. Available only if you specify the pipeline as an array.
|
Reference: MongoDB Documentation (URL)
728x90