MongoDB for Developers with Python Transcripts
Chapter: MongoDB's shell and native query syntax
Lecture: Deleting documents form MongoDB
0:00 After you've inserted some documents and maybe updated a few,
0:03 it might be time to get rid of the old ones, so let's talk about deleting them.
0:06 So again, it's db.collection name. and we're going to apply delete operation.
0:11 And here we can say I'd like to delete one of them,
0:13 delete one, or maybe I want to delete a whole set of them, right,
0:18 the delete one we're passing in something that should be unique,
0:20 like the primary key, and delete many, maybe a bunch of them have the title,
0:23 maybe there is a couple of additions
0:25 like a kindle and a paperback version or something like that.
0:27 So just get rid of all of them with the title being some title.
0:30 So, delete one, delete many— pretty straightforward.