Spring data mongodb sort on multiple fields
You can try something like this.
Aggregation agg = newAggregation(
match(Criteria.where("userId").is(userId)),
sort(Sort.Direction.DESC, "type").and(Sort.Direction.ASC, "createdDate")
);
Little bit late, but for other people... Try this (for spring-data):
private static final Sort NOTE_SORT = new Sort(new Sort.Order(Sort.Direction.ASC, "seen"),
new Sort.Order(Sort.Direction.DESC, "date"),
new Sort.Order(Sort.Direction.ASC, "done"));