@@ -9,7 +9,7 @@ Transform Your Data with Aggregation
99 :values: reference
1010
1111.. meta::
12- :keywords: code example, transform, computed, pipeline
12+ :keywords: code example, transform, computed, pipeline, Atlas Search
1313 :description: Learn how to use the Kotlin Sync driver to perform aggregation operations.
1414
1515.. contents:: On this page
@@ -80,6 +80,7 @@ The following limitations apply when using aggregation operations:
8080 </reference/operator/aggregation/graphLookup/>` stage has a strict
8181 memory limit of 100 megabytes and ignores the ``allowDiskUse`` option.
8282
83+
8384Aggregation Example
8485-------------------
8586
@@ -188,6 +189,50 @@ and adds the ``$explain`` stage to output the operation details:
188189 ...
189190 }
190191
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+
191236Additional Information
192237----------------------
193238
@@ -217,4 +262,7 @@ For more information about executing aggregation operations with the {+driver-sh
217262see the following API documentation:
218263
219264- `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