MongoDB for Developers with Python Transcripts
Chapter: MongoDB's shell and native query syntax
Lecture: Deleting documents form MongoDB

Login or purchase this course to watch this video and the rest of the course contents.
0:00 After you've inserted some documents and maybe updated a few, it might be time to get rid of the old ones, so let's talk about deleting them.
0:07 So again, it's db.collection name. and we're going to apply delete operation. And here we can say I'd like to delete one of them,
0:14 delete one, or maybe I want to delete a whole set of them, right, the delete one we're passing in something that should be unique,
0:21 like the primary key, and delete many, maybe a bunch of them have the title, maybe there is a couple of additions
0:26 like a kindle and a paperback version or something like that. So just get rid of all of them with the title being some title.
0:31 So, delete one, delete many— pretty straightforward.


Talk Python's Mastodon Michael Kennedy's Mastodon