Ticket: Paging - Test Supports paging by cast fails


I have implemented the “Ticket: Paging” solution as:

const displayCursor = cursor.skip(page * moviesPerPage).limit(moviesPerPage)

The test “Supports paging by cast” fails when checking the 60th movie. According to the test it should be “The Da Vinci Code” but in my case it is “True”. I’ve double checked using Compass and the last movie is indeed “True”.

I suspect it is because there are 7 movies with no tomatoes field, so the default sort by tomatoes.viewer.numReviews descending may not return the last 7 movies in the expected order since they are all null.

1 Like


Quick update: I was using a local database and imported the data with mongorestore. I just tried using MongoDB Atlas as suggested in the course and it works.