Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Aggregation Pipeline 1: $match, $group, $project, $unwind, $lookup and $facet
In MongoDB the aggregation pipeline passes documents through stages in order and produces new results; with $match first an index is used, while $unwind multiplies documents along an array. With real output: the $unwind mistake that doubles monthly revenue, $group results identical to the GROUP BY and HAVING results from SQL Temelleri, the optimizer reordering stages, the join strategy of $lookup and $facet for the search page.
Aggregation Pipeline 2: $setWindowFields, $graphLookup, $bucket, $merge Materialized Views and Memory Limits
In MongoDB the counterpart of window functions is $setWindowFields; but a moving average computed without adding the missing days with $densify is based on the documents that exist, not on calendar days. With real output: results identical to the running total, top-N and 7-day average from SQL Temelleri, the category tree with $graphLookup, $bucketAuto, a materialized view refreshed incrementally with $merge, the per-query memory limit in 9.0 and $function.