@@ -9,7 +9,7 @@ Transform Your Data with Aggregation
9
9
:values: reference
10
10
11
11
.. meta::
12
- :keywords: code example, transform, computed, pipeline
12
+ :keywords: code example, transform, computed, pipeline, Atlas Search
13
13
:description: Learn how to use the Kotlin Sync driver to perform aggregation operations.
14
14
15
15
.. contents:: On this page
@@ -80,6 +80,7 @@ The following limitations apply when using aggregation operations:
80
80
</reference/operator/aggregation/graphLookup/>` stage has a strict
81
81
memory limit of 100 megabytes and ignores the ``allowDiskUse`` option.
82
82
83
+
83
84
Aggregation Example
84
85
-------------------
85
86
@@ -188,6 +189,50 @@ and adds the ``$explain`` stage to output the operation details:
188
189
...
189
190
}
190
191
192
+ .. _kotlin-sync-atlas-search-stage:
193
+
194
+ Atlas Search
195
+ ------------
196
+
197
+ You can perform an :atlas:`Atlas Search </atlas-search>` query by creating and running
198
+ an aggregation pipeline that contains one of the following pipeline stages:
199
+
200
+ - ``$search``
201
+ - ``$searchMeta``
202
+
203
+ To learn more about Atlas Search pipeline stages, see :atlas:`Choose the
204
+ Aggregation Pipeline Stage </atlas-search/query-syntax/>` in the Atlas
205
+ documentation.
206
+
207
+ Create a Pipeline Search Stage
208
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209
+
210
+ You can create the search criteria in your Atlas Search pipeline stage
211
+ by using Search operators.
212
+
213
+ .. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst
214
+
215
+ .. replacement:: as-idx-link
216
+
217
+ the :ref:`kotlin-sync-atlas-search-index` guide
218
+
219
+ .. replacement:: atlas-query-operators-example
220
+
221
+ .. io-code-block::
222
+
223
+ .. input:: /includes/aggregation/aggregation.kt
224
+ :language: kotlin
225
+ :start-after: // start-atlas-searchoperator-helpers
226
+ :end-before: // end-atlas-searchoperator-helpers
227
+ :dedent:
228
+
229
+ .. output::
230
+ :language: console
231
+ :visible: false
232
+
233
+ Document{{_id=..., genres=[Comedy, Romance], title=Love at First Bite, year=1979}}
234
+ Document{{_id=..., genres=[Comedy, Drama], title=Love Affair, year=1994}}
235
+
191
236
Additional Information
192
237
----------------------
193
238
@@ -217,4 +262,7 @@ For more information about executing aggregation operations with the {+driver-sh
217
262
see the following API documentation:
218
263
219
264
- `aggregate() <{+driver-api+}/-mongo-collection/aggregate.html>`__
220
- - `AggregateIterable <{+driver-api+}/-aggregate-iterable/index.html>`__
265
+ - `AggregateIterable <{+driver-api+}/-aggregate-iterable/index.html>`__
266
+ - `Aggregates <{+core-api+}/client/model/Aggregates>`__
267
+ - `search() <{+core-api+}/client/model/Aggregates#search(com.mongodb.client.model.search.SearchOperator)>`__
268
+ - `project() <{+core-api+}/client/model/Aggregates#project(org.bson.conversions.Bson)>`__
0 commit comments