mongo聚合字符串类型的数字进行排序
- 设置collation
Collation collation = Collation.of(Locale.CHINESE)
.numericOrdering(true);
- 设置聚合选项
Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(orOperator),
).withOptions(AggregationOptions.builder()
.collation(collation)
.build());