MongoDB CRUD Operations: Modifying Query Results
Learn how to sort and limit query results and how to count documents in MongoDB.
MongoDB CRUD Operations: Modifying Query Results
Unit Overview
In this unit, you’ll learn how to modify query results in MongoDB by using sorts, limits, projections, and counts. First, you will learn how to organize query results by sorting and limiting the documents that are returned. Then you'll explore how to use projection to return selected fields from a query. Finally, you’ll learn how to count the number of documents that match a query. Using these query modifications will help enhance the functionality and performance of your applications.
Prerequisites
- Getting Started with MongoDB Atlas
- MongoDB and the Document Model
- MongoDB CRUD Operations: Insert and Find
- MongoDB CRUD Operations: Replace and Delete
Lessons in This Unit
- Lesson 01: Sorting and Limiting Query Results in MongoDB
- Lesson 02: Returning Specific Data from a Query in MongoDB
- Lesson 03: Counting Documents in a MongoDB Collection

Camden Kirkland I Technical Instructor
Cam is a Technical Instructor at MongoDB where he delivers courses for a wide variety of foundational and advanced topics on the database. Prior to MongoDB, he was a Curriculum Architect designing technical programs for web development, data analytics, and financial technologies for universities all over the country. In a past life he was a Chemist making sure your transformers didn't catch fire.

Emily Pope | Senior Curriculum Designer
Emily is a Senior Curriculum Designer at MongoDB. Prior to MongoDB, Emily worked closely with professors at MIT and Columbia to design bootcamps in full stack development and data science at Emeritus. She also worked as an instructional designer on database and computer science learning experiences at Cengage. Emily loves learning about the everchanging tech space and is passionate about making these skills accessible to a global audience.