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

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

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

Aggregates.bucket介绍

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

代码示例

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

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

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

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

相关文章