From c2e17e085b500da546e05965dbd3bbb62c4c8dc8 Mon Sep 17 00:00:00 2001 From: Mike Woofter <108414937+mongoKart@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:43:03 -0600 Subject: [PATCH] docsp-33327 - update window api (#502) (cherry picked from commit 19a6c219af4d35ba987c2700948cabc025eb89a4) --- source/fundamentals/builders/aggregates.txt | 7 ++++++- .../fundamentals/code-snippets/builders/AggBuilders.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/fundamentals/builders/aggregates.txt b/source/fundamentals/builders/aggregates.txt index 794764118..850baaf9f 100644 --- a/source/fundamentals/builders/aggregates.txt +++ b/source/fundamentals/builders/aggregates.txt @@ -2,7 +2,12 @@ Aggregates Builders =================== -.. default-domain:: mongodb +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: code examples .. contents:: On this page :local: diff --git a/source/includes/fundamentals/code-snippets/builders/AggBuilders.java b/source/includes/fundamentals/code-snippets/builders/AggBuilders.java index 4b5bc7d87..0ab3db891 100644 --- a/source/includes/fundamentals/code-snippets/builders/AggBuilders.java +++ b/source/includes/fundamentals/code-snippets/builders/AggBuilders.java @@ -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 }