Introduction to MongoDb with .NET part 23: first aggregation examples
May 5, 2016 Leave a comment
Introduction
In the previous post we introduced the topic of aggregations in general. Aggregations in MongoDb are similar in purpose to the GROUP BY clause in SQL. They help us analyse the data stored in the database so that understand things like long term business trends, user and customer behaviour, which part of our business is making losses and similar. Aggregation queries are added to the aggregation pipeline using $ operators and the documents are passed from one stage to the next in the pipeline. We will get the aggregation result at the end of the pipeline.
In this post we’ll look at our first aggregation example.