Not being able to pass a test

Good morning!

In Chapter 2: User-Facing Backend, I add the following 3 lines after the TODO in get_movies_faceted:

pipeline.extend(skip_stage)
pipeline.extend(limit_stage)
pipeline.extend(facet_stage)

But the tests always return the error:
pymongo.errors.OperationFailure: Results too large to sort, be more restrictive in filter

I also changed the line:

for:

(as said in the ticket explanation)

Do I need to add anything else? I cannot find a solution. Thanks!
Guillem.

Hi @Guillem_40013,

The order seems right for the pipeline. It seems like something is missing in your stage. Please make sure you are using $match stage to filter out the results.

Also, please check your messages.

Kanika

2 Likes