From the course: MongoDB Python Developer Associate Cert Prep
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Building a MongoDB aggregation pipeline in Python applications
From the course: MongoDB Python Developer Associate Cert Prep
Building a MongoDB aggregation pipeline in Python applications
- Hello. In this video, we'll explore the MongoDB aggregation framework, which is used to build multi-stage queries. You'll learn what aggregation is and how it works, specifically in a Python application with MongoDB. When we build queries by using the aggregation framework, think of the query as comprising discrete stages. Each stage provides output documents that act as an input to the next stage. This sequence of data processing stages is referred to as an aggregation pipeline. If your query can be executed with the find method and does not require additional processing, then use find. If you need to process documents and return computed results, use the aggregation framework. An example would be when you need to summarize data or create new calculated fields. The aggregation framework is more flexible than find and provides powerful primitive operators to define and manipulate documents. An aggregation pipeline…