예를 들어 아래와 같다.
$match 를 통해서 where status = ‘urgent’를 걸러내고
$group 을 통해서 group by productName을 구현하고,
$sum을 이용해서 quantity의 sum을 추출한다.
이렇게 input(match, qroup, sum)를 통해서 output이라는 결과값을 추출해낸다.
이를 도식화하면 아래와 같다.
순차적으로 match, group, sort와 같은 각각의 stage 순서로 수행을 하여 output을 낸다는 점이 기존의 db와 다르다.