SlideShare a Scribd company logo
Mongodb Aggregation Pipeline
Mongodb Aggregation Pipeline consist of stages and each stage transforms the
document. Aggregation applies only on complex Queries.
It is a multi-stage pipeline and in each state and the documents are taken as input
to produce the resultant set of documents.
In the next stage (ID available) the resultant documents are taken as input to
produce output, this process continues till the last stage.
The basic pipeline stages are defined below:
Filters (Stages) that will operate like queries.
The document transformation that modifies the resultant document.
Pipeline provides for matching, grouping,Projecting and sorting documents.
There are three types of aggregations:
1) Aggregate pipelines.
2) Map-Reduce aggregations.
3) Single purpose Evalutionary Query aggregations.
Stages: Aggregation stages define the various operations applied to the
documents in the ipeline. Some common stages include:
• $match : Filters documents based on specified criteria.
• $group : Groups documents by a specified key and allows you to perform
aggregate functions on the grouped data.
• $project : Reshapes documents, specifying which fields to include or
exclude.
• $sort : Sorts the documents based on one or more fields (1 or -1).
• $limit : Limits the number of documents passed to the next stage.
• $skip : Skips a specified number of documents.
• $unwind : Deconstructs an array field, producing a separate document for
each array element.
• $lookup: Combines two collections or Collection related documents.
• Let us discuss the aggregation pipeline with the help of an example:
Explanation:
• In the above example the collection is train, $match stage filters the
documents by the value in class field i.e. class: “first-class” in the first
stage and passes the document to the second stage.
• In the Second Stage, the $group stage groups the documents by the id field
to calculate the sum of fare for each unique id.
• Here, the aggregate() function is used to perform aggregations. It can have
three operators Stages , Expression and Accumulator. These operators
work together to achieve final desired output.
Aggregation Presentation for databses  (1).pptx

More Related Content

PPTX
MongoDB's New Aggregation framework
Chris Westin
 
PPTX
The Aggregation Framework
MongoDB
 
PPTX
Learning MongoDB Aggregations in 10 Minutes
techprane
 
PPTX
mongodb-aggregation-may-2012
Chris Westin
 
PDF
Experiment no 05
Ankit Dubey
 
PPTX
MongoDB Aggregation
Amit Ghosh
 
PDF
MongoDB Aggregation Framework
Caserta
 
PDF
Aggregation Framework MongoDB Days Munich
Norberto Leite
 
MongoDB's New Aggregation framework
Chris Westin
 
The Aggregation Framework
MongoDB
 
Learning MongoDB Aggregations in 10 Minutes
techprane
 
mongodb-aggregation-may-2012
Chris Westin
 
Experiment no 05
Ankit Dubey
 
MongoDB Aggregation
Amit Ghosh
 
MongoDB Aggregation Framework
Caserta
 
Aggregation Framework MongoDB Days Munich
Norberto Leite
 

Similar to Aggregation Presentation for databses (1).pptx (20)

PPTX
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
PPTX
Aggregation in MongoDB
Kishor Parkhe
 
PPT
Schema Design by Chad Tindel, Solution Architect, 10gen
MongoDB
 
KEY
MongoDB Aggregation Framework
Tyler Brock
 
ODP
Aggregation Framework in MongoDB Overview Part-1
Anuj Jain
 
PPTX
The Aggregation Framework
MongoDB
 
PDF
Querying Mongo Without Programming Using Funql
MongoDB
 
PPTX
SH 2 - SES 3 - MongoDB Aggregation Framework.pptx
MongoDB
 
PDF
Precog & MongoDB User Group: Skyrocket Your Analytics
MongoDB
 
PPTX
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & Aggregation
MongoDB
 
PPTX
MongoDB 3.2 - Analytics
Massimo Brignoli
 
PDF
2012 mongo db_bangalore_roadmap_new
MongoDB
 
PPTX
Low Cost Business Intelligence Platform for MongoDB instances using MEAN stack
Avinash Kaza
 
PPTX
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
PDF
Using MongoDB and Python
Mike Bright
 
PDF
2016 feb-23 pyugre-py_mongo
Michael Bright
 
PPTX
1403 app dev series - session 5 - analytics
MongoDB
 
PPTX
Introduction to MongoDB
Raghunath A
 
PPTX
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
PPTX
MongoDB - Aggregation Pipeline
Jason Terpko
 
MongoDB Aggregation MongoSF May 2011
Chris Westin
 
Aggregation in MongoDB
Kishor Parkhe
 
Schema Design by Chad Tindel, Solution Architect, 10gen
MongoDB
 
MongoDB Aggregation Framework
Tyler Brock
 
Aggregation Framework in MongoDB Overview Part-1
Anuj Jain
 
The Aggregation Framework
MongoDB
 
Querying Mongo Without Programming Using Funql
MongoDB
 
SH 2 - SES 3 - MongoDB Aggregation Framework.pptx
MongoDB
 
Precog & MongoDB User Group: Skyrocket Your Analytics
MongoDB
 
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & Aggregation
MongoDB
 
MongoDB 3.2 - Analytics
Massimo Brignoli
 
2012 mongo db_bangalore_roadmap_new
MongoDB
 
Low Cost Business Intelligence Platform for MongoDB instances using MEAN stack
Avinash Kaza
 
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
Using MongoDB and Python
Mike Bright
 
2016 feb-23 pyugre-py_mongo
Michael Bright
 
1403 app dev series - session 5 - analytics
MongoDB
 
Introduction to MongoDB
Raghunath A
 
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
MongoDB - Aggregation Pipeline
Jason Terpko
 
Ad

More from plvdravikumarit (9)

PPTX
HCI user interface & characterstics of interfaces.pptx
plvdravikumarit
 
PPTX
UNIT-III menuspresentation in HCI types of menus.pptx
plvdravikumarit
 
PPTX
BUSINESS FUNCTIONS IN HCI CONTAINS SCOPE AND OPERATIONAL RESEARCH DATA.pptx
plvdravikumarit
 
PPTX
HCI physical charcaeristics Main causes.pptx
plvdravikumarit
 
PPTX
GRID FS operationg system data for nosql.pptx
plvdravikumarit
 
PPTX
Authentication Users for data accessing in collections for it.pptx
plvdravikumarit
 
PPTX
CURD Operations in monngodb and limited operations
plvdravikumarit
 
PPTX
NOSQL PRESENTATION ON INTRRODUCTION Intro.pptx
plvdravikumarit
 
PPTX
5_Aggregations.pptx AGGREGATIONS IN NOSQL
plvdravikumarit
 
HCI user interface & characterstics of interfaces.pptx
plvdravikumarit
 
UNIT-III menuspresentation in HCI types of menus.pptx
plvdravikumarit
 
BUSINESS FUNCTIONS IN HCI CONTAINS SCOPE AND OPERATIONAL RESEARCH DATA.pptx
plvdravikumarit
 
HCI physical charcaeristics Main causes.pptx
plvdravikumarit
 
GRID FS operationg system data for nosql.pptx
plvdravikumarit
 
Authentication Users for data accessing in collections for it.pptx
plvdravikumarit
 
CURD Operations in monngodb and limited operations
plvdravikumarit
 
NOSQL PRESENTATION ON INTRRODUCTION Intro.pptx
plvdravikumarit
 
5_Aggregations.pptx AGGREGATIONS IN NOSQL
plvdravikumarit
 
Ad

Recently uploaded (20)

PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
Information Retrieval and Extraction - Module 7
premSankar19
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
Software Testing Tools - names and explanation
shruti533256
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
JUAL EFIX C5 IMU GNSS GEODETIC PERFECT BASE OR ROVER
Budi Minds
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 

Aggregation Presentation for databses (1).pptx

  • 1. Mongodb Aggregation Pipeline Mongodb Aggregation Pipeline consist of stages and each stage transforms the document. Aggregation applies only on complex Queries. It is a multi-stage pipeline and in each state and the documents are taken as input to produce the resultant set of documents. In the next stage (ID available) the resultant documents are taken as input to produce output, this process continues till the last stage. The basic pipeline stages are defined below: Filters (Stages) that will operate like queries. The document transformation that modifies the resultant document. Pipeline provides for matching, grouping,Projecting and sorting documents.
  • 2. There are three types of aggregations: 1) Aggregate pipelines. 2) Map-Reduce aggregations. 3) Single purpose Evalutionary Query aggregations.
  • 3. Stages: Aggregation stages define the various operations applied to the documents in the ipeline. Some common stages include: • $match : Filters documents based on specified criteria. • $group : Groups documents by a specified key and allows you to perform aggregate functions on the grouped data. • $project : Reshapes documents, specifying which fields to include or exclude. • $sort : Sorts the documents based on one or more fields (1 or -1). • $limit : Limits the number of documents passed to the next stage. • $skip : Skips a specified number of documents. • $unwind : Deconstructs an array field, producing a separate document for each array element. • $lookup: Combines two collections or Collection related documents.
  • 4. • Let us discuss the aggregation pipeline with the help of an example:
  • 5. Explanation: • In the above example the collection is train, $match stage filters the documents by the value in class field i.e. class: “first-class” in the first stage and passes the document to the second stage. • In the Second Stage, the $group stage groups the documents by the id field to calculate the sum of fare for each unique id. • Here, the aggregate() function is used to perform aggregations. It can have three operators Stages , Expression and Accumulator. These operators work together to achieve final desired output.