MongoDB CRUD Operations in Python
Learn how to perform basic CRUD operations with the MongoDB Python driver.
MongoDB CRUD Operations in Python
Unit Overview
In this unit, you'll learn how to perform CRUD operations by using Python. First, you'll learn how BSON documents are represented in Python. Next, you'll learn how to insert, query and retrieve, update, and delete documents in a Python application. Finally, you'll learn how to create a multi-document transaction.
Prerequisites
Lessons in This Unit
- Lesson 01: Working with MongoDB Documents in Python
- Lesson 02: Inserting a Document in Python Applications
- Lesson 03: Querying a MongoDB Collection in Python Applications
- Lesson 04: Updating Documents in Python Applications
- Lesson 05: Deleting Documents in Python Applications
- Lesson 06: Creating MongoDB Transactions in Python Applications
-
01.
-
02.Lesson 2: Inserting a Document in Python Applications
- Learn
- Pratice
-
03.Lesson 3: Querying a MongoDB Collection in Python Applications
- Learn
- Practice
-
04.Lesson 4: Updating Documents in Python Applications
- Learn
- Practice
-
05.Lesson 5: Deleting Documents in Python Applications
- Learn
- Practice
-
06.Lesson 6: Creating MongoDB Transactions in Python Applications
- Learn
- Practice
-
07.Conclusion
- Learn
Julianna Chen I Senior Curriculum Engineer
Julianna is a Senior Curriculum Engineer on the Education team, based in Vancouver, Canada. She’s developed educational content at universities and non-profits for over ten years, and is passionate about supporting access to quality technical education worldwide.
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.
Hi there and welcome! In this unit, you’ll learn how to perform basic CRUD operations with your Python applications.
CRUD stands for Create, Read, Update, and Delete.
I’m Julianna. I’m a Curriculum Engineer here at MongoDB, and I’ll be working with you through this unit.
Using CRUD, you’ll be able to interact with your data from your Python application. After all, a database is only useful if you can leverage the data.
In this unit, we’ll also cover how to create a multi-document transaction in Python so that you can ensure your operations are ACID compliant.
The lessons in this unit consist of short video lectures followed by quiz questions and labs so that you can practice what you learned.
First, you’ll learn how BSON documents are represented in Python.
Then, you’ll learn how to insert documents into your MongoDB database from a Python application.
You’ll also learn how to query and retrieve documents from a collection.
Next, you’ll learn how to update documents, both one at a time and in batches.
Then you’ll learn how to delete single or multiple documents.
Finally, you’ll learn how to create a multi-document transaction by using the callback API.
Before you begin this unit, you should have a basic understanding of: Python, the MongoDB database and document model, and Atlas.
You’ll also need to set up an Atlas account with a free tier cluster.
By the end of this unit, you will be able to describe how BSON documents are represented in Python, perform basic CRUD operations in Python, and create multi-document transactions.
Let’s get started!