I am trying to get all books that match my several book_ids, but instead I only get one of the books.
books = mydb.Book.find({"book_id ": book_id})
I am trying to get all books that match my several book_ids, but instead I only get one of the books.
books = mydb.Book.find({"book_id ": book_id})
2
Answers
I solved my problem,
listBooks=[] listBooks.append(book_id)
You can use
$in
to find all the documents that match any value in your listbook_ids
see the doc