-
Notifications
You must be signed in to change notification settings - Fork 10
[Kotlin Sync] Add additional SearchOperator helper methods for the rest of the Atlas Search operators #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
aa84832
e5bcf39
520d9ec
51c8a66
df1d30d
0ea55ce
223840c
dcdd743
d0b3027
29befdb
d13b106
619f989
2866c79
fdabb99
091eec4
32f617c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,7 +9,7 @@ Transform Your Data with Aggregation | |||||||||||||||||||||||||||||
:values: reference | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. meta:: | ||||||||||||||||||||||||||||||
:keywords: code example, transform, computed, pipeline | ||||||||||||||||||||||||||||||
:keywords: code example, transform, computed, pipeline, Atlas Search | ||||||||||||||||||||||||||||||
:description: Learn how to use the Kotlin Sync driver to perform aggregation operations. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. contents:: On this page | ||||||||||||||||||||||||||||||
|
@@ -80,6 +80,40 @@ The following limitations apply when using aggregation operations: | |||||||||||||||||||||||||||||
</reference/operator/aggregation/graphLookup/>` stage has a strict | ||||||||||||||||||||||||||||||
memory limit of 100 megabytes and ignores the ``allowDiskUse`` option. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. _kotlin-sync-atlas-search-stage: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Pipelines Stages for Atlas Search | ||||||||||||||||||||||||||||||
--------------------------------- | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
:atlas:`Atlas Search </atlas-search>` queries take the form of an aggregation pipeline stage. Atlas | ||||||||||||||||||||||||||||||
Search provides ``$search`` and ``$searchMeta`` stages, both of which must be the first | ||||||||||||||||||||||||||||||
stage in any query pipeline. For more information about Atlas pipeline stages, | ||||||||||||||||||||||||||||||
see the :atlas:`Choose the Aggregation Pipeline Stage | ||||||||||||||||||||||||||||||
</atlas-search/query-syntax/>` page in the Atlas | ||||||||||||||||||||||||||||||
manual. | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: simplify/combine sentences
Suggested change
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: consider revising the language in the table in this shared include to have the first column header be |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. replacement:: atlas-query-operators-example | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: in the docs-shared file - change the code description to actually reference the strings as they appear in the text. This is helpful for making sure users see the 1:1 mapping of the description to the code example
etc |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
.. code-block:: kotlin | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
val searchStage: Bson = Aggregates.search( | ||||||||||||||||||||||||||||||
SearchOperator.compound() | ||||||||||||||||||||||||||||||
.filter( | ||||||||||||||||||||||||||||||
listOf( | ||||||||||||||||||||||||||||||
SearchOperator.text(fieldPath("genres"), "Drama"), | ||||||||||||||||||||||||||||||
SearchOperator.phrase(fieldPath("cast"), "sylvester stallone"), | ||||||||||||||||||||||||||||||
SearchOperator.numberRange(fieldPath("year")).gtLt(1980, 1989), | ||||||||||||||||||||||||||||||
SearchOperator.wildcard(fieldPath("title"), "Rocky *") | ||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: use a literalinclude and include output |
||||||||||||||||||||||||||||||
.. replacement:: searchoperator-interface-api-docs | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
the `SearchOperator Interface API documentation <{+core-api+}/client/model/search/SearchOperator.html>`__ | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: correct the indentation of the replacement content |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Aggregation Example | ||||||||||||||||||||||||||||||
------------------- | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -44,8 +44,8 @@ and features: | |||||||
|
||||||||
.. replacement:: atlas-query-operators | ||||||||
|
||||||||
the `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__ | ||||||||
interface API documentation | ||||||||
the :ref:`Pipelines Stages for Atlas Search | ||||||||
<kotlin-sync-atlas-search-stage>` section | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
.. _kotlin-sync-version-5.3: | ||||||||
|
||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: Consider moving this section after the main aggregation examples on this page. Also consider renaming this section to just
Atlas Search
and then creating a subsection after the paragraph calledCreate a Search Query
or something like that?