My Aggregation Query skip,order is not working propery with java

Viewed 20

Here is my Java code. skip missing some records. also order is not working.

AggregateIterable<Document> propertiesDoc = collection.aggregate(Arrays.asList(
                    Aggregates.match(queryNew),
                     Aggregates.group("$similarGroup", Accumulators.sum("count", 1),Accumulators.first("data", "$$ROOT")),
                     Aggregates.skip(skipCount),
                    Aggregates.limit(searchRequest.getItemsPerPage()),
                    Aggregates.sort(descending("salePrice")))
                    );
0 Answers
Related