Skip to content

Conversation

mcmorisi
Copy link
Collaborator

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

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Jul 22, 2024

👷 Deploy request for docs-kotlin-sync pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ef73965

// start-index-compound-query
val filter = and(
eq(Movie::type.name, "movie"),
`in`(Movie::genres.name, "Drama")
Copy link
Collaborator Author

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.

Copy link
Collaborator

@stephmarie17 stephmarie17 left a 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

Comment on lines 60 to 61
The following is an example of a query that uses the index created in
the preceding code example:
Copy link
Collaborator

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)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcmorisi mcmorisi requested review from a team and jyemin and removed request for a team July 23, 2024 20:26
@mcmorisi mcmorisi merged commit 0379473 into mongodb:master Jul 24, 2024
1 of 2 checks passed
@mcmorisi mcmorisi deleted the DOCSP-41143-compound-indexes branch July 24, 2024 13:00
mcmorisi added a commit that referenced this pull request Jul 24, 2024
(cherry picked from commit 0379473)
mcmorisi added a commit that referenced this pull request Jul 24, 2024
(cherry picked from commit 0379473)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants