11.. _csharp-aggregation-stages:
2+ .. _csharp-builders-aggregation:
3+ .. _csharp-linq:
24
35===========================
46Aggregation Pipeline Stages
@@ -104,10 +106,9 @@ Aggregation Stage Methods
104106-------------------------
105107
106108The following table lists the builder methods in the {+driver-short+} that correspond
107- to stages in the aggregation pipeline. To learn more about an aggregation stage,
108- follow the link from the method name to its reference page in the {+mdb-server+} manual.
109- To learn more about a builder method, follow the link from the method name to its
110- dedicated page.
109+ to stages in the aggregation pipeline. To learn more about an aggregation stage and
110+ see a code example for the equivalent C# method, follow the link from the stage name
111+ to its reference page in the {+mdb-server+} manual.
111112
112113If an aggregation stage isn't in the table, the driver doesn't provide a builder method for
113114it. In this case, you must use the
@@ -125,56 +126,56 @@ to your pipeline.
125126 * - :manual:`$bucket </reference/operator/aggregation/bucket/>`
126127 - Categorizes incoming documents into groups, called buckets,
127128 based on a specified expression and bucket boundaries.
128- - :ref:` Bucket() <csharp-aggregation-bucket> `
129+ - `` Bucket()` `
129130
130131 * - :manual:`$bucketAuto </reference/operator/aggregation/bucketAuto/>`
131132 - Categorizes incoming documents into a specific number of
132133 groups, called buckets, based on a specified expression.
133134 Bucket boundaries are automatically determined in an attempt
134135 to evenly distribute the documents into the specified number
135136 of buckets.
136- - :ref:` BucketAuto() <csharp-aggregation-bucketauto> `
137+ - `` BucketAuto()` `
137138
138139 * - :manual:`$changeStream </reference/operator/aggregation/changeStream/>`
139140 - Returns a change stream cursor for the
140141 collection. This stage can occur only once in an aggregation
141142 pipeline and it must occur as the first stage.
142- - :ref:` ChangeStream() <csharp-aggregation-changestream> `
143+ - `` ChangeStream()` `
143144
144145 * - :manual:`$changeStreamSplitLargeEvent </reference/operator/aggregation/changeStreamSplitLargeEvent/>`
145146 - Splits large change stream events that exceed 16 MB into smaller fragments returned
146147 in a change stream cursor.
147148
148149 You can use ``$changeStreamSplitLargeEvent`` only in a ``$changeStream`` pipeline, and
149150 it must be the final stage in the pipeline.
150- - :ref:` ChangeStreamSplitLargeEvent() <csharp-aggregation-changestreamsplitlargeevent> `
151+ - `` ChangeStreamSplitLargeEvent()` `
151152
152153 * - :manual:`$count </reference/operator/aggregation/count/>`
153154 - Returns a count of the number of documents at this stage of
154155 the aggregation pipeline.
155- - :ref:` Count() <csharp-aggregation-count> `
156+ - `` Count()` `
156157
157158 * - :manual:`$densify </reference/operator/aggregation/densify/>`
158159 - Creates new documents in a sequence of documents where certain values in a field are missing.
159- - :ref:` Densify() <csharp-aggregation-densify> `
160+ - `` Densify()` `
160161
161162 * - :manual:`$documents </reference/operator/aggregation/documents/>`
162163 - Returns literal documents from input expressions.
163- - :ref:` Documents() <csharp-aggregation-documents> `
164+ - `` Documents()` `
164165
165166 * - :manual:`$facet </reference/operator/aggregation/facet/>`
166167 - Processes multiple aggregation pipelines
167168 within a single stage on the same set
168169 of input documents. Enables the creation of multi-faceted
169170 aggregations capable of characterizing data across multiple
170171 dimensions, or facets, in a single stage.
171- - :ref:` Facet() <csharp-aggregation-facet> `
172+ - `` Facet()` `
172173
173174 * - :manual:`$graphLookup </reference/operator/aggregation/graphLookup/>`
174175 - Performs a recursive search on a collection. This method adds
175176 a new array field to each output document that contains the traversal
176177 results of the recursive search for that document.
177- - :ref:` GraphLookup() <csharp-aggregation-graphlookup> `
178+ - `` GraphLookup()` `
178179
179180 * - :manual:`$group </reference/operator/aggregation/group/>`
180181 - Groups input documents by a specified identifier expression
@@ -183,27 +184,27 @@ to your pipeline.
183184 document per each distinct group. The output documents
184185 contain only the identifier field and, if specified, accumulated
185186 fields.
186- - :ref:` Group() <csharp-aggregation-group> `
187+ - `` Group()` `
187188
188189 * - :manual:`$limit </reference/operator/aggregation/limit/>`
189190 - Passes the first *n* documents unmodified to the pipeline,
190191 where *n* is the specified limit. For each input document,
191192 outputs either one document (for the first *n* documents) or
192193 zero documents (after the first *n* documents).
193- - :ref:` Limit() <csharp-aggregation-limit> `
194+ - `` Limit()` `
194195
195196 * - :manual:`$lookup </reference/operator/aggregation/facet/>`
196197 - Performs a left outer join to another collection in the
197198 *same* database to filter in documents from the "joined"
198199 collection for processing.
199- - :ref:` Lookup() <csharp-aggregation-lookup> `
200+ - `` Lookup()` `
200201
201202 * - :manual:`$match </reference/operator/aggregation/match/>`
202203 - Filters the document stream to allow only matching documents
203204 to pass unmodified into the next pipeline stage.
204205 For each input document, outputs either one document (a match) or zero
205206 documents (no match).
206- - :ref:` Match() <csharp-aggregation-match> `
207+ - `` Match()` `
207208
208209 * - :manual:`$merge </reference/operator/aggregation/merge/>`
209210 - Writes the resulting documents of the aggregation pipeline to
@@ -213,24 +214,24 @@ to your pipeline.
213214 custom update pipeline) the results into an output
214215 collection. To use this stage, it must be
215216 the last stage in the pipeline.
216- - :ref:` Merge() <csharp-aggregation-merge> `
217+ - `` Merge()` `
217218
218219 * - :manual:`$out </reference/operator/aggregation/out/>`
219220 - Writes the resulting documents of the aggregation pipeline to
220221 a collection. To use this stage, it must be
221222 the last stage in the pipeline.
222- - :ref:` Out() <csharp-aggregation-out> `
223+ - `` Out()` `
223224
224225 * - :manual:`$project </reference/operator/aggregation/project/>`
225226 - Reshapes each document in the stream, such as by adding new
226227 fields or removing existing fields. For each input document,
227228 outputs one document.
228- - :ref:` Project() <csharp-aggregation-project> `
229+ - `` Project()` `
229230
230231 * - :manual:`$rankFusion </reference/operator/aggregation/rankFusion/>`
231232 - Uses a rank fusion algorithm to combine results from a Vector Search
232233 query and an Atlas Search query.
233- - :ref:` RankFusion() <csharp-aggregation-rankfusion> `
234+ - `` RankFusion()` `
234235
235236 * - :manual:`$replaceRoot </reference/operator/aggregation/replaceRoot/>`
236237 - Replaces a document with the specified embedded document. The
@@ -240,7 +241,7 @@ to your pipeline.
240241 top level.
241242
242243 The ``$replaceWith`` stage is an alias for the ``$replaceRoot`` stage.
243- - :ref:` ReplaceRoot() <csharp-aggregation-replaceroot> `
244+ - `` ReplaceRoot()` `
244245
245246 * - :manual:`$replaceWith </reference/operator/aggregation/replaceWith/>`
246247 - Replaces a document with the specified embedded document.
@@ -249,12 +250,12 @@ to your pipeline.
249250 the embedded document to the top level.
250251
251252 The ``$replaceWith`` stage is an alias for the ``$replaceRoot`` stage.
252- - :ref:` ReplaceWith() <csharp-aggregation-replacewith> `
253+ - `` ReplaceWith()` `
253254
254255 * - :manual:`$sample </reference/operator/aggregation/sample/>`
255256 - Randomly selects the specified number of documents from its
256257 input.
257- - :ref:` Sample() <csharp-aggregation-sample> `
258+ - `` Sample()` `
258259
259260 * - :manual:`$search </reference/operator/aggregation/search/>`
260261 - Performs a full-text search of the field or fields in an
@@ -265,7 +266,7 @@ to your pipeline.
265266 available for self-managed deployments. To learn more, see
266267 :atlas:`Atlas Search Aggregation Pipeline Stages
267268 </reference/atlas-search/query-syntax>` in the Atlas documentation.
268- - :ref:` Search() <csharp-aggregation-search> `
269+ - `` Search()` `
269270
270271 * - :manual:`$searchMeta </reference/operator/aggregation/searchMeta/>`
271272 - Returns different types of metadata result documents for the
@@ -277,52 +278,52 @@ to your pipeline.
277278 and is not available for self-managed deployments. To learn
278279 more, see :atlas:`Atlas Search Aggregation Pipeline Stages
279280 </reference/atlas-search/query-syntax>` in the Atlas documentation.
280- - :ref:` SearchMeta() <csharp-aggregation-searchmeta> `
281+ - `` SearchMeta()` `
281282
282283 * - :manual:`$set </reference/operator/aggregation/set/>`
283284 - Adds new fields to documents. Like the ``Project()`` method,
284285 this method reshapes each
285286 document in the stream by adding new fields to
286287 output documents that contain both the existing fields
287288 from the input documents and the newly added fields.
288- - :ref:` Set() <csharp-aggregation-set> `
289+ - `` Set()` `
289290
290291 * - :manual:`$setWindowFields </reference/operator/aggregation/setWindowFields/>`
291292 - Groups documents into windows and applies one or more
292293 operators to the documents in each window.
293- - :ref:` SetWindowFields() <csharp-aggregation-setwindowfields> `
294+ - `` SetWindowFields()` `
294295
295296 * - :manual:`$skip </reference/operator/aggregation/skip/>`
296297 - Skips the first *n* documents, where *n* is the specified skip
297298 number, and passes the remaining documents unmodified to the
298299 pipeline. For each input document, outputs either zero
299300 documents (for the first *n* documents) or one document (if
300301 after the first *n* documents).
301- - :ref:` Skip() <csharp-aggregation-skip> `
302+ - `` Skip()` `
302303
303304 * - :manual:`$sort </reference/operator/aggregation/sort/>`
304305 - Reorders the document stream by a specified sort key. The documents remain unmodified.
305306 For each input document, outputs one document.
306- - :ref:` Sort() <csharp-aggregation-sort> `
307+ - `` Sort()` `
307308
308309 * - :manual:`$sortByCount </reference/operator/aggregation/sortByCount/>`
309310 - Groups incoming documents based on the value of a specified
310311 expression, then computes the count of documents in each
311312 distinct group.
312- - :ref:` SortByCount() <csharp-aggregation-sortbycount> `
313+ - `` SortByCount()` `
313314
314315 * - :manual:`$unionWith </reference/operator/aggregation/unionWith/>`
315316 - Combines pipeline results from two collections into a single
316317 result set.
317- - :ref:` UnionWith() <csharp-aggregation-unionwith> `
318+ - `` UnionWith()` `
318319
319320 * - :manual:`$unwind </reference/operator/aggregation/unwind/>`
320321 - Deconstructs an array field from the input documents to
321322 output a document for *each* element. Each output document
322323 replaces the array with an element value. For each input
323324 document, outputs *n* Documents, where *n* is the number of
324325 array elements. *n* can be zero for an empty array.
325- - :ref:` Unwind() <csharp-aggregation-unwind> `
326+ - `` Unwind()` `
326327
327328 * - :manual:`$vectorSearch </reference/operator/aggregation/vectorSearch/>`
328329 - Performs an :abbr:`ANN (Approximate Nearest Neighbor)` or
@@ -333,7 +334,7 @@ to your pipeline.
333334 This stage is available only for MongoDB Atlas clusters, and is not
334335 available for self-managed deployments. To learn more, see
335336 :ref:`Atlas Vector Search <csharp-atlas-vector-search>`.
336- - :ref:` VectorSearch() <csharp-aggregation-vectorsearch> `
337+ - `` VectorSearch()` `
337338
338339API Documentation
339340-----------------
0 commit comments