I have generated the necessary pipeline for User Report ticket in compass and correspondingly below is the code in CommentDao for the method mostActiveCommenters
List mostActive = new ArrayList<>();
List pipeline = new LinkedList<>();
Bson groupStage= Aggregates.group("$email", Accumulators.sum(“numComments”, 1));
Bson sort = Aggregates.sort(Sorts.descending(“numComments”));
pipeline.add(groupStage); pipeline.add(sort); pipeline.add(limit);
I am not able to cast the result into List , can you pls provide some pointers to cast the result into a Critic list object. Or the approach being used needs to be changed?