-
Notifications
You must be signed in to change notification settings - Fork 10
DOCSP-41143: Compound Indexes #15
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
DOCSP-41143: Compound Indexes #15
Conversation
👷 Deploy request for docs-kotlin-sync pending review.Visit the deploys page to approve it
|
// start-index-compound-query | ||
val filter = and( | ||
eq(Movie::type.name, "movie"), | ||
`in`(Movie::genres.name, "Drama") |
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.
This is a Kotlin (and probably Java) quirk – in
is a language keyword AND a Filters
method. To use the method as such you need to surround it with backticks.
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.
LGTM 🚀 left a few small comments, but once the test gets sorted out should be gtg
source/indexes/compound-index.txt
Outdated
The following is an example of a query that uses the index created in | ||
the preceding code example: |
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] Maybe this introduction can be reworded to improve clarity? It can be hard to parse "following example" vs "preceding example" all in one sentence.
When creating a compound index, you must specify the following: | ||
|
||
- The fields on which to create the index | ||
- The sort order for each field (ascending or descending) |
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.
[q] Is there a default sort order if the sort order isn't specified or is specifying always required?
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.
It's required – source
---------------------- | ||
|
||
To learn more about compound indexes, see :manual:`Compound Indexes </core/index-compound>` | ||
in the {+mdb-server+} manual. |
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] Would linking to this resource be helpful for the reader: https://www.mongodb.com/docs/manual/tutorial/equality-sort-range-rule/#std-label-esr-indexing-rule
(cherry picked from commit 0379473)
(cherry picked from commit 0379473)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-41143
Staging - https://preview-mongodbmcmorisi.gatsbyjs.io/kotlin-sync/DOCSP-41143-compound-indexes/indexes/compound-index/
Self-Review Checklist