Unable to pass testProjectionShape

Dear all,

From my Intellij Idea framework I cannot pass this test because when I use the “Bson projection” I can not understand why. I do write: "Bson projection = Projections.include(“country”). In the moviesCollection array I do insert in projection between brackets first a new Document and then the name field country and a value.

I do not know where I am wrong exactly after reveiwing QueryBuilders and BasicReads and BasicWrites at least twice.

However I’m having a similar problem with getMoviesByCast method: after Bson when I write projections it turns into underlined grey which it means it might not work and in .sort(sort) the word inside brakets appears in red and I do not have a clear idea of what is missing. I know I erased a null! and maybe I should not.

I have the feeling that projections concept is not clear enough for me applied to Java, so can anyone help me, please?

Thanks in advance,

O.

The “country” field is used for the query filter, and the projection requires the “title” field in the ticket.

The “.sort(sort)”, I think the method is passed with the “sortKey” as one of the parameters, while “sort” is not a valid variable in your codes.

1 Like