@@ -56,6 +56,99 @@ class MONGOCXX_API pipeline {
5656 // /
5757 ~pipeline ();
5858
59+ // /
60+ // / Adds new fields to documents.
61+ // /
62+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/addFields/
63+ // /
64+ // / @param fields_to_add
65+ // / A document specifying the fields to add. For each field specified in this parameter, a
66+ // / corresponding field will be added to the documents, where the value of the added field is
67+ // / the result of evaluating the specified expression.
68+ // /
69+ pipeline& add_fields (bsoncxx::document::view_or_value fields_to_add);
70+
71+ // /
72+ // / Categorizes documents into groups, called buckets, based on a specified expression and
73+ // / bucket boundaries.
74+ // /
75+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/bucket/
76+ // /
77+ // / @param bucket_args
78+ // / The specification for the bucket operation. The required fields `groupBy` and
79+ // / `boundaries` must be included.
80+ // /
81+ pipeline& bucket (bsoncxx::document::view_or_value bucket_args);
82+
83+ // /
84+ // / Categorizes documents into a specific number of groups, called buckets, based on a
85+ // / specified expression. Bucket boundaries are automatically determined in an attempt to
86+ // / evenly distribute the documents into the specified number of buckets.
87+ // /
88+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/bucketAuto/
89+ // /
90+ // / @param bucket_auto_args
91+ // / The specification for the bucket_auto operation. This required fields `groupBy` and
92+ // / `buckets` must be included.
93+ // /
94+ pipeline& bucket_auto (bsoncxx::document::view_or_value bucket_auto_args);
95+
96+ // /
97+ // / Returns statistics regarding a collection or view.
98+ // /
99+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/collStats/
100+ // /
101+ // / @param coll_stats_args
102+ // / The specification for the coll_stats operation. See link above for a list of valid
103+ // / options.
104+ // /
105+ pipeline& coll_stats (
106+ bsoncxx::document::view_or_value coll_stats_args = bsoncxx::document::view{});
107+
108+ // /
109+ // / Returns a document containing a count of the number of documents input to the stage.
110+ // /
111+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/count/
112+ // /
113+ // / @param field
114+ // / Name of the field for the count to be written to.
115+ // /
116+ pipeline& count (std::string field);
117+
118+ // /
119+ // / Processes multiple aggregation pipelines within a single stage on the same set of input
120+ // / documents.
121+ // /
122+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/facet/
123+ // /
124+ // / @param facet_args
125+ // / The specification for the facet operation. Each field in the the provided document should
126+ // / specify an aggregation pipeline, as an array.
127+ // /
128+ pipeline& facet (bsoncxx::document::view_or_value facet_args);
129+
130+ // /
131+ // / Outputs documents in order of nearest to farthest from a specified point.
132+ // /
133+ // / @see https://docs.mongodb.com/manual/reference/operator/aggregation/geoNear/
134+ // /
135+ // / @param geo_near_args
136+ // / The specification for the geo_near operation. The required fields `near` and
137+ // / `distanceField` must be included.
138+ // /
139+ pipeline& geo_near (bsoncxx::document::view_or_value geo_near_args);
140+
141+ // /
142+ // / Performs a recursive search on a collection.
143+ // /
144+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/graphLookup/
145+ // /
146+ // / @param graph_lookup_args
147+ // / The specification for the graph_lookup operation. The required fields `from`,
148+ // / `connectFromField`, `startWith`, `connectToField`, and `as` must be included.
149+ // /
150+ pipeline& graph_lookup (bsoncxx::document::view_or_value graph_lookup_args);
151+
59152 // /
60153 // / Groups documents by some specified expression and outputs to the next stage a
61154 // / document for each distinct grouping. The output documents contain an `_id` field
@@ -72,6 +165,13 @@ class MONGOCXX_API pipeline {
72165 // /
73166 pipeline& group (bsoncxx::document::view_or_value group_args);
74167
168+ // /
169+ // / Returns statistics regarding the use of each index for the collection.
170+ // /
171+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/indexStats/
172+ // /
173+ pipeline& index_stats ();
174+
75175 // /
76176 // / Limits the number of documents passed to the next stage in the pipeline.
77177 // /
@@ -138,6 +238,17 @@ class MONGOCXX_API pipeline {
138238 // /
139239 pipeline& redact (bsoncxx::document::view_or_value restrictions);
140240
241+ // /
242+ // / Promotes a specified document to the top level and replaces all other fields.
243+ // /
244+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/replaceRoot/
245+ // /
246+ // / @param replace_root_args
247+ // / The specification for the replace_root operation. The required field `newRoot` must be
248+ // / included.
249+ // /
250+ pipeline& replace_root (bsoncxx::document::view_or_value replace_root_args);
251+
141252 // /
142253 // / Randomly selects the specified number of documents that pass into the stage and passes the
143254 // / remaining documents to the next stage in the pipeline.
@@ -170,6 +281,53 @@ class MONGOCXX_API pipeline {
170281 // /
171282 pipeline& sort (bsoncxx::document::view_or_value ordering);
172283
284+ // /
285+ // / Groups incoming documents based on the value of a specified expression, then computes the
286+ // / count of documents in each distinct group.
287+ // /
288+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/sortByCount/
289+ // /
290+ // / @param field_expression
291+ // / The expression to group by, as an object. The expression can not evaluate to an object.
292+ // /
293+ // / @note
294+ // / This overload of sort_by_count() is intended to be used when the desired sort is over a
295+ // / grouping of the result of a complex expression computed from the input documents.
296+ // /
297+ pipeline& sort_by_count (bsoncxx::document::view_or_value field_expression);
298+
299+ // /
300+ // / Groups incoming documents based on the value of a specified expression, then computes the
301+ // / count of documents in each distinct group.
302+ // /
303+ // / @see https://docs.mongodb.com/master/reference/operator/aggregation/sortByCount/
304+ // /
305+ // / @param field_expression
306+ // / The expression to group by, as a string. To specify a field path, prefix the field path
307+ // / with a dollar sign (`$`).
308+ // /
309+ // / @note
310+ // / This overload of sort_by_count() is intended to be used when the desired sort is over a
311+ // / grouping of the value of a particular element in the input documents.
312+ // /
313+ pipeline& sort_by_count (std::string field_expression);
314+
315+ // /
316+ // / Deconstructs an array field from the input documents to output a document for each element.
317+ // / Each output document is an input document with the value of its array field replaced by
318+ // / an element from the unwound array.
319+ // /
320+ // / @see http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/
321+ // /
322+ // / @param unwind_args
323+ // / The specification for the unwind operation. The required field @path must be included.
324+ // /
325+ // / @note
326+ // / This overload of unwind() is intended to be used when additional options other than the
327+ // / field name need to be specified.
328+ // /
329+ pipeline& unwind (bsoncxx::document::view_or_value unwind_args);
330+
173331 // /
174332 // / Deconstructs an array field from the input documents to output a document for each element.
175333 // / Each output document is an input document with the value of its array field replaced by
@@ -180,6 +338,10 @@ class MONGOCXX_API pipeline {
180338 // / @param field_name
181339 // / The name of the field to unwind.
182340 // /
341+ // / @note
342+ // / This overload of unwind() is intended to be used when no options other than the field name
343+ // / need to be specified.
344+ // /
183345 pipeline& unwind (std::string field_name);
184346
185347 // /
0 commit comments