MongoDB with Async Python Transcripts
Chapter: Document Databases
Lecture: And Operators in Queries

Login or purchase this course to watch this video and the rest of the course contents.
0:00 As we've already discussed, the way that we query the data is to pass a prototypical JSON object. So here we want to find a book by its title.
0:11 So we just say title, again case-sensitive, colon, and then the value. In this case, it's a string from the corner of his eye.
0:20 So we actually get two books back, these two books by Dean Kunt. Maybe one is like an audio book versus print or hardback versus paperback.
0:31 I don't know. Doesn't show all the details of the records, but something like that, right? Now maybe we want to be more specific.
0:38 So if you want to be more specific in your queries, we can pass two different things. So we could pass the title and the ISBN.
0:45 And this query would say I want the book whose title is the one here as well as the ISBN also listed here.
0:54 So when you pass the values in like this, everything must match. This is considered an ""and"" type of query.
1:01 The title is from the corner of his eye and the ISBN is 0553582747.


Talk Python's Mastodon Michael Kennedy's Mastodon