本文整理了Java中com.mongodb.client.model.Aggregates.bucket()
方法的一些代码示例,展示了Aggregates.bucket()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Aggregates.bucket()
方法的具体详情如下:
包路径:com.mongodb.client.model.Aggregates
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!