Skip to content

Commit 3997ae9

Browse files
committed
atlas searchoperation helper methods
1 parent 3256557 commit 3997ae9

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

source/fundamentals/aggregation.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,49 @@ first element in the ``categories`` field.
215215
Results(name=456 Cookies Shop, firstCategory=Bakery)
216216
Results(name=XYZ Steak Buffet, firstCategory=Steak)
217217

218+
.. _kotlin-cr-atlas-search-stage:
219+
220+
Pipelines Stages for Atlas Search
221+
---------------------------------
222+
223+
:atlas:`Atlas Search </atlas-search>` queries take the form of an aggregation pipeline stage. Atlas
224+
Search provides ``$search`` and ``$searchMeta`` stages, both of which must be the first
225+
stage in any query pipeline. For more information about Atlas pipeline stages,
226+
see the :atlas:`Choose the Aggregation Pipeline Stage
227+
</atlas-search/query-syntax/>` page in the Atlas
228+
manual.
229+
230+
.. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst
231+
232+
.. replacement:: atlas-query-operators-example
233+
234+
.. code-block:: kotlin
235+
236+
val searchStage: Bson = Aggregates.search(
237+
SearchOperator.compound()
238+
.filter(
239+
listOf(
240+
SearchOperator.text(fieldPath("genres"), "Drama"),
241+
SearchOperator.phrase(fieldPath("cast"), "sylvester stallone"),
242+
SearchOperator.numberRange(fieldPath("year")).gtLt(1980, 1989),
243+
SearchOperator.wildcard(fieldPath("title"), "Rocky *")
244+
)
245+
)
246+
)
247+
248+
.. replacement:: searchoperator-interface-api-docs
249+
250+
the `SearchOperator Interface API documentation
251+
<{+core-api+}/com/mongodb/client/model/search/SearchOperator.html>`__
252+
253+
API Documentation
254+
-----------------
255+
218256
For more information about the methods and classes mentioned in this section,
219257
see the following API Documentation:
220258

221259
- `Accumulators <{+core-api+}/client/model/Accumulators.html>`__
222260
- `$group <{+core-api+}/client/model/Aggregates.html#group(TExpression,java.util.List)>`__
223261
- `$project <{+core-api+}/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__
224262
- `Projections <{+core-api+}/client/model/Projections.html>`__
263+
- `SearchOperator Interface <{+core-api+}/com/mongodb/client/model/search/SearchOperator.html>`__

source/whats-new.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ and features:
4949
the `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__
5050
interface API documentation
5151

52+
.. replacement:: atlas-query-operators
53+
54+
the :ref:`Pipelines Stages for Atlas Search
55+
<kotlin-cr-atlas-search-stage>` section
56+
5257
.. _kotlin-coroutine-version-5.3:
5358

5459
What's New in 5.3

0 commit comments

Comments
 (0)