What was wrong in my code Ticket: Faceted Search giving me incorrect

Bson skipStage = Aggregates.skip(...);
Bson matchStage = Aggregates.match(...);
Bson sortStage = Aggregates.sort(...);
Bson limitStage = Aggregates.limit(...);
Bson facetStage = buildFacetStage();

List<Bson> pipeline = new LinkedList<>();

pipeline.add(matchStage);
pipeline.add(sortStage);
pipeline.add(skipStage);
pipeline.add(limitStage);
pipeline.add(facetStage);
   

moviesCollection.aggregate(pipeline).iterator().forEachRemaining(movies::add);

return movies;

}

Posting potential solution is against forum policy. The forum is here to ask questions not to provide help.

Please delete your post.

1 Like

As I reread the thread I have noticed a question as the title.

To be able to help you. We do not need to see your code but the error messages that it produces.