MongoDB CRUD Operations in PHP
Learn how to perform basic create, read, update, and delete (CRUD) operations with the MongoDB PHP driver.
MongoDB CRUD Operations in PHP
Unit Overview
In this unit, you'll learn how to perform CRUD operations by using PHP. First, you'll learn how BSON documents are represented in PHP. Next, you'll learn how to insert, query and retrieve, update, and delete documents in a PHP application. Finally, you'll learn how to create a multi-document transaction.
Prerequisites
Lessons in This Unit
- Lesson 1 – Working with MongoDB Documents in PHP
- Lesson 2 – Inserting a Document in PHP Applications
- Lesson 3 – Querying a MongoDB Collection in PHP Applications
- Lesson 4 – Updating Documents in PHP Applications
- Lesson 5 – Deleting Documents in PHP Applications
- Lesson 6 – Creating MongoDB Transactions in PHP Applications
-
01.
-
02.Lesson 2: Inserting a Document in PHP Applications
- Learn
- Practice
-
03.Lesson 3: Querying a MongoDB Collection in PHP Applications
- Learn
- Practice
-
04.Lesson 4: Updating Documents in PHP Applications
- Learn
- Practice
-
05.Lesson 5: Deleting Documents in PHP Applications
- Learn
- Practice
-
06.Lesson 6: Creating MongoDB Transactions in PHP Applications
- Learn
- Practice
-
07.Conclusion
- Learn
Julie Gauthier | Senior Curriculum Engineer
Julie is a Senior Curriculum Engineer on the University Team at MongoDB. She holds a BS and MS in Computer Science, and has a background as a software engineer. Julie has taught hundreds of people web development, with a goal of empowering everyone with technology!
Vick Mena | Director, Curriculum
My name is Vick and I've been in the wild for over 25 years. I grew up at IBM working on the BIOS for the IBM eServer line in Austin, TX before moving to Wall St. I've worked on all phases of software development from low-level to middleware to UI but feel most comfortable in the middle. I also drank the devops kool-aid having moved a product line to AWS while at Dow Jones & Co with the help of an amazing team. I then pivoted into the secure space and worked on software/hardware reverse engineering. I always thought I'd eventually teach and this role lets me leverage all of my experience to lead this motley crew of passionate educators.
Welcome! In this unit, you will learn how to perform basic CRUD operations for your PHP application. CRUD stands for Create, Read, Update, and Delete.
I’m Julie. I’m a Curriculum Engineer here at MongoDB, and I’ll be working with you through this unit.
In this unit, we’ll also cover how to create a multi-document transaction in PHP so that you can ensure your operations are ACID compliant.
The lessons in this unit consist of videos followed by quiz questions and labs so that you can practice what you learned
First, you will learn how BSON documents are expressed in PHP.
Then, you’ll learn how to insert documents into an application.
You’ll also learn how to query and retrieve documents from a collection.
Next, you will learn how to update one or multiple documents at a time.
Then, you’ll learn how to delete one or multiple documents.
Finally, you’ll learn how to create a multi-document transaction.
Before you begin this unit, you should have a basic understanding of: PHP, The MongoDB database and document model, and Atlas.
You will also need to set up an Atlas account
By the end of this unit, you will be able to describe how BSON documents are expressed in PHP, perform basic CRUD operations in PHP, and create a multi-document transaction.
Let's get started!