com.mongodb.client.model.Aggregates.bucketAuto()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(207)

本文整理了Java中com.mongodb.client.model.Aggregates.bucketAuto()方法的一些代码示例,展示了Aggregates.bucketAuto()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Aggregates.bucketAuto()方法的具体详情如下:
包路径:com.mongodb.client.model.Aggregates
类名称:Aggregates
方法名:bucketAuto

Aggregates.bucketAuto介绍

[英]Creates a $bucketAuto pipeline stage
[中]创建$bucketAuto管道阶段

代码示例

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * Creates a $bucketAuto pipeline stage
 *
 * @param <TExpression> the groupBy expression type
 * @param groupBy       the criteria to group By
 * @param buckets       the number of the buckets
 * @return the $bucketAuto pipeline stage
 * @mongodb.driver.manual reference/operator/aggregation/bucketAuto/ $bucketAuto
 * @mongodb.server.release 3.4
 * @since 3.4
 */
public static <TExpression> Bson bucketAuto(final TExpression groupBy, final int buckets) {
  return bucketAuto(groupBy, buckets, new BucketAutoOptions());
}

代码示例来源:origin: org.mongodb/mongodb-driver-core

/**
 * Creates a $bucketAuto pipeline stage
 *
 * @param <TExpression> the groupBy expression type
 * @param groupBy       the criteria to group By
 * @param buckets       the number of the buckets
 * @return the $bucketAuto pipeline stage
 * @mongodb.driver.manual reference/operator/aggregation/bucketAuto/ $bucketAuto
 * @mongodb.server.release 3.4
 * @since 3.4
 */
public static <TExpression> Bson bucketAuto(final TExpression groupBy, final int buckets) {
  return bucketAuto(groupBy, buckets, new BucketAutoOptions());
}

相关文章