Overview of db.py machinery

I’m having a great deal of trouble following the passage of code from function to function. Eg. when testing for filter = {‘genres’: [‘Action’]}, the json document, filter, is passed to the get_movies function. Comments within the get_movies function tell me
“The filters from the API are passed to the build_query_sort_projectmethod, which constructs a query, sort, and projection, and then that query is executed by this method (get_movies`).”
How does the get_movies call from the unit test pass first through build_query_sort_project?
In addition, and more specifically:
. what does list(movies) do to the cursor, movies, created from the query?
. are searches by text, cast, or genres mutually exclusive?