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