File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
docs/reference/content/driver/tutorials Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,8 @@ The [aggregation pipeline]({{<docsref "core/aggregation-pipeline" >}}) is a fram
2828 import com.mongodb.client.model.Accumulators ;
2929 import com.mongodb.client.model.Projections ;
3030 import com.mongodb.client.model.Filters ;
31-
32- import org.bson.Document ;
33- ```
34-
35- - Include the following code which the examples in the tutorials will use to print the results of the aggregation:
3631
37- ```java
38- Block<Document > printBlock = new Block<Document > () {
39- @Override
40- public void apply (final Document document ) {
41- System . out. println(document. toJson());
42- }
43- };
32+ import org.bson.Document ;
4433 ```
4534
4635## Connect to a MongoDB Deployment
@@ -73,7 +62,7 @@ collection.aggregate(
7362 Aggregates . match(Filters . eq(" categories" , " Bakery" )),
7463 Aggregates . group(" $stars" , Accumulators . sum(" count" , 1 ))
7564 )
76- ). forEach(printBlock );
65+ ). forEach(doc - > System . out . println(doc . toJson()) );
7766```
7867
7968### Use Aggregation Expressions
@@ -98,7 +87,7 @@ collection.aggregate(
9887 )
9988 )
10089 )
101- ). forEach(printBlock );
90+ ). forEach(doc - > System . out . println(doc . toJson()) );
10291```
10392
10493### Explain an Aggregation
You can’t perform that action at this time.
0 commit comments