Skip to content

Commit

Permalink
docsp-33327 - update window api (#502)
Browse files Browse the repository at this point in the history
(cherry picked from commit 19a6c21)
  • Loading branch information
mongoKart committed Jan 16, 2024
1 parent 40a356a commit c2e17e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion source/fundamentals/builders/aggregates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
Aggregates Builders
===================

.. default-domain:: mongodb
.. facet::
:name: genre
:values: reference

.. meta::
:keywords: code examples

.. contents:: On this page
:local:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ private void setWindowFieldsStage() {
// begin setWindowFields
Window pastMonth = Windows.timeRange(-1, MongoTimeUnit.MONTH, Windows.Bound.CURRENT);
setWindowFields("$localityId", Sorts.ascending("measurementDateTime"),
WindowedComputations.sum("monthlyRainfall", "$rainfall", pastMonth),
WindowedComputations.avg("monthlyAvgTemp", "$temperature", pastMonth));
WindowOutputFields.sum("monthlyRainfall", "$rainfall", pastMonth),
WindowOutputFields.avg("monthlyAvgTemp", "$temperature", pastMonth));
// end setWindowFields
}

Expand Down

0 comments on commit c2e17e0

Please sign in to comment.