How to custom sort only specific results in Spring MongoDB?

Is it possible to sort only results that matches a condition in Spring Mongo? Let us say I have this data: Color Fruit Amount Orange Orange 23 Red Apple 4 Red Strawberry 66 Yellow Banana 2 I …

How to count array elements properly with multiple aggregation in Spring Data MongoDB?

I need to create advanced aggregation using Spring Data MongoDB having model like that: @Getter @Setter @Document public class City { @Id @JsonSerialize(using = ToStringSerializer.class) …

How to get list of data containing count of a field using Aggregation and Criteria in Spring Boot with MangoDB

Requirement: documents-bookdata collection may have multiple objects with same bookPublisherName but different bookName. Means multiple books can have same publisher so need to extract count of books …