Skip to content

Commit

Permalink
Count with upper limit support in Fluent API (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence authored May 29, 2023
1 parent 5c80226 commit 930decc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fluent_api/select_aggregation_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ impl FirestoreAggregationFieldExpr {
FirestoreAggregationOperator::Count(FirestoreAggregationOperatorCount::new()),
))
}

#[inline]
pub fn count_up_to(self, up_to: usize) -> Option<FirestoreAggregation> {
Some(FirestoreAggregation::new(self.field_name).with_operator(
FirestoreAggregationOperator::Count(
FirestoreAggregationOperatorCount::new().with_up_to(up_to),
),
))
}
}

impl FirestoreAggregationExpr for FirestoreAggregation {
Expand Down

0 comments on commit 930decc

Please sign in to comment.