Database, MongoDB

A use case and implementation of MongoDB Aggregation queries.

In any DBMS, aggregations are operations that process data records and return computed results. MongoDB provides a rich set of aggregation operations that examine and perform calculations on the data sets. Running data aggregation on the mongod instance simplifies application code and limits resource requirements. In my current...

by Manish Kapoor
Tag: group


Group By in MongoDB(with $group)

MongoDB provides a rich set of aggregation. $group is one of them, with the help of $group, we can group documents (similar as group By in SQL). Lets understand by an example: Suppose we have following collection of blogs: [js] { userId:1, name:"Suroor", title:"AngularJS: Getting started with Directive", rating:3} { userId:2,...

by Amit Kumar
Tag: group


How to Determine Average in MongoDB

MongoDB provides several ways of computing the average value of a group in a collection. One of the simplest ways of determining average is using the method The method bunches the documents of a collection on the basis of the keys mentioned and executes aggregation functions on them. This...

by Sakshi Tyagi
Tag: group