SQL to aggregation

An aggregation pipeline can replace and augment querying operations in the shell. A common pattern for development is:

  • Verify that we have the correct data structures and get quick results using a series of queries in the shell
  • Prototype pipeline results using the aggregation framework
  • Refine and refactor if/when needed either by ETL processes to get data into a dedicated data warehouse or by more extensive usage of the application layer to get the insights that we need

In the following table, we can see how SQL commands map to the aggregation framework operators:

SQL

Aggregation framework

WHERE / HAVING

$match

GROUP BY

$group

SELECT

$project

ORDER BY

$sort

LIMIT

$limit

sum() / count()

$sum

join

$lookup

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.31.206