@@ -82,8 +82,7 @@ public static void main(String[] args) {
82
82
page .bucketAutoOptionsStage ();
83
83
page .facetStage ();
84
84
page .vectorSearchPipeline ();
85
- // Fix required: https://jira.mongodb.org/browse/DOCSP-33327
86
- // page.setWindowFieldsStage();
85
+ page .setWindowFieldsStage ();
87
86
page .aggregationExample ();
88
87
}
89
88
@@ -95,16 +94,14 @@ private void aggregationExample() {
95
94
// end aggregationSample
96
95
}
97
96
98
- /* Fix required: https://jira.mongodb.org/browse/DOCSP-33327
99
97
private void setWindowFieldsStage () {
100
98
// begin setWindowFields
101
99
Window pastMonth = Windows .timeRange (-1 , MongoTimeUnit .MONTH , Windows .Bound .CURRENT );
102
100
setWindowFields ("$localityId" , Sorts .ascending ("measurementDateTime" ),
103
- WindowedComputations .sum("monthlyRainfall", "$rainfall", pastMonth),
104
- WindowedComputations .avg("monthlyAvgTemp", "$temperature", pastMonth));
101
+ WindowOutputFields .sum ("monthlyRainfall" , "$rainfall" , pastMonth ),
102
+ WindowOutputFields .avg ("monthlyAvgTemp" , "$temperature" , pastMonth ));
105
103
// end setWindowFields
106
104
}
107
- */
108
105
109
106
private void facetStage () {
110
107
// begin facet
@@ -258,10 +255,11 @@ private void advancedLookupStage() {
258
255
Bson innerJoinLookup = lookup ("warehouses" , variables , pipeline , "stockdata" );
259
256
// end advanced lookup
260
257
// Missing advancedLookup assignment
261
- // MongoCursor<Document> cursor = collection.aggregate(asList(advancedLookup)).cursor();
262
- // cursor.forEachRemaining(doc -> System.out.println(doc.toJson()));
263
- // database = mongoClient.getDatabase("sample_mflix");
264
- // collection = database.getCollection("movies");
258
+ // MongoCursor<Document> cursor =
259
+ // collection.aggregate(asList(advancedLookup)).cursor();
260
+ // cursor.forEachRemaining(doc -> System.out.println(doc.toJson()));
261
+ // database = mongoClient.getDatabase("sample_mflix");
262
+ // collection = database.getCollection("movies");
265
263
}
266
264
267
265
private void basicLookupStage () {
@@ -332,7 +330,7 @@ private void vectorSearchPipeline() {
332
330
limit ,
333
331
options ),
334
332
project (
335
- metaVectorSearchScore ("vectorSearchScore" )));
333
+ metaVectorSearchScore ("vectorSearchScore" )));
336
334
// end vectorSearch
337
335
338
336
// begin vectorSearch-output
@@ -345,7 +343,6 @@ private void vectorSearchPipeline() {
345
343
// Example output: "vectorSearch score: 0.887437105178833"
346
344
}
347
345
348
-
349
346
private void documentsStage () {
350
347
// begin documents
351
348
documents (asList (
0 commit comments