getMoviesByCountry Help

I understand the MongoDB lesson, but I’m fighting everything else (i.e. IntelliJ). I figured out how to implement the getMoviesByCountry method (merely by looking at the similar methods), but I can’t get the IDE parameter “country” to work. How do I use the parameter “country” in the method? It deletes “value:” if I try to edit it. If I could see a solution I’d learn it. I tried hardcoding “Kosovo” and it passes, but can’t get the parameter to pass into the method. Any help would be greatly appreciated.

we are not having the column country in the collection video.movies
That might be the reason for not able to query the results based on the country.

Thanks Suresh. I see the collection is countries, but the getMoviesByCountry method has a parameter country. I can’t seem to edit anything in the method pertaining to country without totally breaking the method.

What are the error messages?

Just the unit test error of not returning 2 movies, but I know it’s just because I don’t have the parameter hooked up in the getMoviesByCountry method (if I bypass the parameter and hardcode a value it works). Also, the test on the mflix page fails. Not sure what those fieldName: and value: items are in the IDE, but they disappear as soon as I try to define the query filter. I think I should have taken an IntelliJ class before this one.

In your first message you say that you cannot use the parameter country. You must have an error or something telling you why.

I think your problem is that you are unaware of the following:

https://docs.oracle.com/javase/6/docs/technotes/guides/language/varargs.html

Thanks steevej-1495 for your help. I am aware of varargs, but may not be implementing correctly. I’m guessing I would use the $in operator to support multiple countries and being an array? I can’t seem to find any MongoDB examples of this in Java (only in the shell).

Now that the deadline has passed. Is there any way to see the correct method? I see I can get the correct validation code (show answer), but that doesn’t help much. Would love to know what the correct method was.

Since the forum is accessible to all after the course we cannot post answer here because the next cohort will have access to the solutions. You may send me your email in a file with the following link. I just hope it is ok with the Mongo University Staff.

Thank you Steevej-1495. I will keep the solution private. I had just put too much time into it to never know the answer. My hope was to learn this by example, instead of just being filtered out of the class. So thank you very much.

Hi @ Rik_14140, if you did not receive my email yet, check your spam.