MongoDB Documentation, Release 3.0.4 7.4.3 SQL to Aggregation Mapping Chart The aggregation pipeline (page 439) allows MongoDB to provide native aggregation capabilities that corresponds to many common data aggregation operations in SQL. The following table provides an overview of common SQL aggregation terms, functions, and concepts and the corre- sponding MongoDB aggregation operators : The following table presents a quick reference of SQL aggregation statements and the corresponding MongoDB state- ments. The examples in the table assume the following conditions: { cust_id: "abc123", ord_date: ISODate("2012-11-02T17:04:11.102Z"), status: 'A', price: 50, items: [ { sku: "xxx", qty: 25, price: 1 }, { sku: "yyy", qty: 25, price: 1 } ] } • The MongoDB examples assume one collection orders that contain documents of the following prototype: • The SQL examples assume two tables, orders and order_lineitem that join by the order_lineitem.order_id and the orders.id columns. Examples SQL Terms, Functions, and Concepts MongoDB Aggregation Operators WHERE $match GROUP BY $group HAVING $match SELECT $project ORDER BY $sort LIMIT $limit SUM() $sum COUNT() $sum join No direct corresponding operator; however , the $unwind operator allows for somewhat similar functionality, but with fields embedded within the document. Chapter 7. Aggregation 476