From the course: MongoDB Java Developer Associate Cert Prep
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Finding documents by using logical operators
From the course: MongoDB Java Developer Associate Cert Prep
Finding documents by using logical operators
- Hi folks. In this video, you'll learn how to delete documents in MongoDB by using deleteOne() and deleteMany(). Let's jump right into it. Imagine that you're working with a database that contains information about various podcasts. There's a single document for each podcast that gets added to the collection, which is called Podcasts, but there's a problem. At some point, a duplicate document for a podcast was inserted accidentally. We need to delete the duplicate. To achieve this, first, we'll use find() to determine which document to delete, and then we'll use the deleteOne() method. Furthermore, your managers ask you to remove all podcasts with a category of crime. First, we provide a filter document to the find() method that contains the uploaded date of the duplicate document which was provided to us by our manager. The date we were given is April 28th, 2020. In the Shell, we'll use the ISODate wrapper to…
Contents
-
-
-
-
-
-
Inserting documents in a MongoDB collection2m 45s
-
(Locked)
Finding documents in a MongoDB collection2m 45s
-
(Locked)
Finding documents by using comparison operators3m 20s
-
(Locked)
Querying on array elements in MongoDB2m 54s
-
(Locked)
Finding documents by using logical operators4m 19s
-
(Locked)
MongoDB CRUD operations: Insert and find documents review1m
-
-
-
-
-
-
-
-
-
-
-