M220N Chapter 2: Ticket projectionm

Screen Shot 2022-10-16 at 8.17.53 PM

Problem:

User Story

“As a user, I’d like to be able to search movies by country and see a list of movie titles. I should be able to specify a comma-separated list of countries to search multiple countries.”

Task

Implement the GetMoviesByCountryAsync method in MoviesRepository.cs to search movies by country and use projection to return only the Id and Title fields.

Important

text

You should specify the sort order after the Find call and before the Project call. The unit tests expect the sort order to be by “title”, descending: .SortByDescending(m=>m.Title)

MFlix Functionality

Once you complete this ticket, the UI will allow movie searches by one or more countries.

Testing and Running the Application

Be sure to look at the tests in the TestGetMoviesByCountry method of MoviesRepositoryTests.cs to understand what is expected.

If the application is already running, stop the application and run the unit test for this ticket. The unit test for this ticket is TestUpdateUserPreferences. You can run the test from within Visual Studio or by executing the following command from the mflix-cs directory:

Hello everyone so I’m trying to complete the ticket but I’m getting an error when it comes to return the output, could someone tell me what I’m doing wrong?

Hi @Jahmur_Lopez, welcome to the community :wave: .

Can you please provide us the error message that you are getting while doing this?

Thanks & Regards,
Sourabh Bagrecha,
MongoDB