Share
Embed
Transcript
11 slides
-
Slide 1 | STYLIGHT | Proud to bleed purple |
@stylight RAPID DATA INSIGHTS With MongoDB’s Aggregation Framework -
Slide 2 | STYLIGHT | Proud to bleed purple |
@stylight PIPELINE Aggregation Framework 1. A pipeline is a series of operations 2. Conceptually, members of a collection are passed through a pipeline to produce a result -
Slide 3 | STYLIGHT | Proud to bleed purple |
@stylight PIPELINE OPERATIONS Aggregation Framework - $match - find({…}) - $sort - find().sort({…}) - $limit - find().limit() - $skip - find().skip() - $group - SQL’s GROUP BY - $unwind - dole out arrays! - $project - find({},{…}), but better! -
Slide 4 | STYLIGHT | Proud to bleed purple |
@stylight EXPRESSION OPERATIONS Aggregation Framework - Conditional: $cond, $ifNull - Boolean: $and, $or, $not - Comparison: $cmp, $eq, $ne, $gt, $gte, $lt, $lte - Arithmetic: $add, $multiply, $subtract, $divide, $mod - String: $strcasecmp, $substr, $concat, $toUpper, $toLower - Date: $dayOf[Year|Month|Week], $year, $month, …, $millisecond - Group: $sum, $avg, $min, $max, $first, $last, $push, $addToSet -
Slide 5 | STYLIGHT | Proud to bleed purple |
@stylight STYLIGHT Our data Stylight Shop click-outs transactions -
Slide 6 | STYLIGHT | Proud to bleed purple |
@stylight LIVE EXAMPLES Aggregation Framework Let’s dig in! -
Slide 7 | STYLIGHT | Proud to bleed purple |
@stylight TIPS AND LIMITATIONS Aggregation Framework Tips: - Use $match/$sort as early as possible in pipeline - Can’t use $project to create arrays! Limitations: - Result size is limited to 16MB - Memory limits for certain pipeline operators ($sort) - Some types unsupported: Binary, Code, deprecated types -
Slide 8 | STYLIGHT | Proud to bleed purple |
@stylight CONCLUSION Aggregation Framework - Nice addition to toolbox for getting quick insights - No silver bullet! -
Slide 9 | STYLIGHT | Proud to bleed purple |
@stylight THANK YOU FOR YOUR ATTENTION! Questions? -
Dimitar Roustchev Backend Engineer STYLIGHT GmbH +49 (0)89 – 1222
895 – 0 [email protected] @droustchev http://www.stylight.com Nymphenburger Straße 86 80636 Munich, Germany Slide 10 | STYLIGHT | Proud to bleed purple | @stylight -
Slide 11 | STYLIGHT | Proud to bleed purple |
@stylight REFERENCES Aggregation Framework - Aggregation Framework: http://docs.mongodb.org/manual/reference/aggregation