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.
Updating documents in Python applications
From the course: MongoDB Python Developer Associate Cert Prep
Updating documents in Python applications
- Hello. In this video, you'll learn how to perform single and multiple document updates in MongoDB with a Python application by using PyMongo's update one and update many methods. You'll learn how to update the value of an existing field and how to define a new field and value in an update. First, let's update a single document by using the update one method. We use the update one method when we need to update a single document that matches some specified criteria. The syntax for update one is db.collection.update_one. Update one has two required arguments, a filter document that specifies the selection criteria and an update document that specifies the modifications. To demonstrate update one, we'll work with a database named bank that contains an accounts collection. We want to increase the balance of a specific account by $100. Here's the document that contains the account that we need to update,…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Working with MongoDB documents in Python3m 46s
-
(Locked)
Inserting a document in Python applications3m 20s
-
(Locked)
Querying a MongoDB collection in Python applications3m 38s
-
(Locked)
Updating documents in Python applications4m 21s
-
(Locked)
Deleting documents in Python applications3m 24s
-
(Locked)
Creating MongoDB transactions in Python applications5m 47s
-
(Locked)
MongoDB CRUD operations in Python review1m 13s
-
(Locked)
-
-
-
-
-
-
-