Mapper & Reducer Program using Aggregation Framework of MongoDB
Krushna Prasad Sahoo
★ O???S???? E??????? ★ R?? H?? C???????? S???????s? I? O???S???? A???? ★ Ass??. C???? E??????? (GCP) ★ M????s??? C???????? A???? A???? ★
Hello everyone, hope all are doing good. In this article I will be explaining a bit about MongoDB & its Aggregation Framework , then we'll see how the Mapper Reducer program can be created using that...
What is MongoDB ?
MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need. MongoDB’s document model is simple for developers to learn and use, while still providing all the capabilities needed to meet the most complex requirements at any scale.
Some of the Features of MongoDB are :
What is Aggregation Framework in Mongo ?
In MongoDB, aggregation operations process the data records/documents and return computed results. It collects values from various documents and groups them together and then performs different types of operations on that grouped data like sum, average, minimum, maximum, etc to return a computed result.
Here is an example of simple MongoDB.
MongoDB provides three ways to perform aggregation
Now let's have a look as Aggregation Pipeline :
In MongoDB, the aggregation pipeline consists of stages and each stage transforms the document. Or in other words, the aggregation pipeline is a multi-stage pipeline, so in each state, the documents taken as input and produce the resultant set of documents now in the next stage(id available) the resultant documents taken as input and produce output, this process is going on till the last stage. The basic pipeline stages provide filters that will perform like queries and the document transformation modifies the resultant document and the other pipeline provides tools for grouping and sorting documents. You can also use the aggregation pipeline in sharded collection.
Now let's use Aggregation Framework & create Mapper Reducer program...
That's all Guys !! We have seen how to use Aggregation Framework for Mapper & Reducer Program.
Thank You???