Incorrect number of movies returned

I am getting incorrect number of movies from my query when I run through pytest.

Not sure how this is possible. I thought I should get no answer (which I did before I fixed my query).
I am also running my pytest as: C:\Python36\Scripts\pytest.exe -m projection
because for some reason, even when I have the anaconda and anaconda/Scripts in %Path% I was getting an error: “Cannot open C:\Python36\”
But I suspect this usage of pytest.exe with full path should not cause my assignment issue.
Any help is appreciated.

Hi, I also tried MongoDB Compass to verify the results.

And the results match my current test results (but fail with the expected assertion)

Does the test need to be updated?


The query

{ "countries" : [ "Russia" , "Japan" ] }

matches an array named countries that is exactly equals to [ "Russia" , "Japan" ]. It will not match [ "Japan" , "Russia" ]. It will not match [ "Russia" , "French" , "Japan" ]. It is way too restrictive compared to the requirements.

The are other array operators more suited. Enjoy the following

1 Like

Thank you, @steevej for the tip. I wasn’t thinking beyond lesson 1 in m001 :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.