---
title: "Discussion on \"Aggregation in MongoDB\" | Hashnode"
description: "Discussion on \"Aggregation in MongoDB\". Hello, devs 👋\nIn this blog, we will learn the basics of the MongoDB aggregation framework to filter, sort, group, and transform our MongoDB results. MongoDB helps us to do all these operations through aggregation pipelines which are a series of oper..."
url: "https://hashnode.com/posts/aggregation-in-mongodb/62594c412f84e0d4fc33b1cb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Aggregation in MongoDB](https://saurabhbomble.hashnode.dev/aggregation-in-mongodb?utm_source=hashnode&utm_medium=feed)

Hello, devs 👋 In this blog, we will learn the basics of the MongoDB aggregation framework to filter, sort, group, and transform our MongoDB results. MongoDB helps us to do all these operations through aggregation pipelines which are a series of oper...

Apr 15, 2022 · 7 min read · saurabhbomble.hashnode.dev  
Read the article

-   [#mongodb](https://hashnode.com/tag/mongodb)
-   [#databases](https://hashnode.com/tag/databases)
-   [#backend](https://hashnode.com/tag/backend)
-   [#nodejs](https://hashnode.com/tag/nodejs)

## Written by

[Saurabh Bomble](https://hashnode.com/@saurabh-107)

@saurabh-107 · Pune, India

  
[View profile](https://hashnode.com/@saurabh-107)

Software developer

Hey! I am Saurabh, an aspiring developer, and a keen learner.

## Responses 2

Markdown supported · ⌘↵ to post

[Gourav Ojha](https://hashnode.com/@GouravOjha)

[Apr 15, 2022](https://hashnode.com/posts/aggregation-in-mongodb/62594c412f84e0d4fc33b1cb/comment/6259b98c2f84e0d4fc33bf90)

Very nice article. Just a small suggestion from my end. The article could have been more engaging for someone who is new to Mongo if you had given a comparison of similar SQL commands to that of MongoDB aggregations.

Ex :- SELECT id,age,language FROM collection WHERE username = "saurabh" AND age > 18;

Really enjoyed reading it !

[Saurabh Bomble](https://hashnode.com/@saurabh-107)

[Apr 17, 2022](https://hashnode.com/posts/aggregation-in-mongodb/62594c412f84e0d4fc33b1cb/comment/6259b98c2f84e0d4fc33bf90#reply-625bc7682f84e0d4fc33e1fa)

Glad you liked it. Also, thanks for the suggestion

[Rishabh Rawat](https://hashnode.com/@rrawat)

[Apr 15, 2022](https://hashnode.com/posts/aggregation-in-mongodb/62594c412f84e0d4fc33b1cb/comment/6259ae0552fb7bd53380d765)

Hey Saurabh, liked the quick introduction to the aggregation pipeline.

Just wanted to highlight that some stages have a [max space limit on the number of documents](https://www.mongodb.com/docs/manual/core/aggregation-pipeline-limits/#memory-restrictions) it can process.

For example, group stage can only process documents of size 100MB at max. To get around this limitation, one needs to allow disc use.

[Saurabh Bomble](https://hashnode.com/@saurabh-107)

[Apr 17, 2022](https://hashnode.com/posts/aggregation-in-mongodb/62594c412f84e0d4fc33b1cb/comment/6259ae0552fb7bd53380d765#reply-625bc7a752fb7bd53380fadb)

Ohh thanks, I didn't know that.
