Issue with Search by country - projection.py

hello,

I have been on this subject for sometime now, my query test using jupyter notebook shows successful, but when i add the code on the db.py, i will have "Projection: The return from the api was incorrect when searching by country" using the status page on the browser to validate but on the console debug state it will return a value of “200” >>> 127.0.0.1 - - [16/Nov/2019 22:43:12] “GET /api/v1/movies/countries?countries=Australia HTTP/1.1” 200 - <<<< confirming successful

Please I need help on the solution.
Here is my syntax

countries = [countries]
countries = db.movies.find({“countries”: {"$in": countries }}, { “title”: 1 })
for results in countries:
** return (results)**

return list(db.movies.find().limit(1))

Please in addition: When I run the search, there is a authentic result, but the status page does not the generate the code for submission

Are you sure you want to restrict the result to a single movie?

@steevej-1495, Yea, I know how to handle that. thank you

Culprits -->

What do you get when you do this?
Note that the main thing that is expected of you in this lab is to adjust the filter criteria… no additional lines of code needed. In addition, look at the test file for this lab and see what type of object is passed to the function that you’re dealing with. This will be crucial going forward.

There’s a comment in the function that mentions what @steevej-1495 is hinting on. If you don’t handle this correctly it will fail.

@007_jb, Thank you so much, i have done it, “no additional lines of code needed” ease the job. thank you once again

1 Like

:slightly_smiling_face::+1: