-
Notifications
You must be signed in to change notification settings - Fork 43
Docsp 26803 adding wildcard code example #405
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 all commits
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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -396,6 +396,25 @@ For more information, see the :manual:`Unique Indexes</core/index-unique>` page | |||||||||||
|
||||||||||||
.. driver-content-end | ||||||||||||
|
||||||||||||
Wildcard Indexes | ||||||||||||
~~~~~~~~~~~~~~~~ | ||||||||||||
|
||||||||||||
.. _wildcard-indexes: | ||||||||||||
|
||||||||||||
Wildcard indexes enable queries against unknown or arbitrary fields. | ||||||||||||
These indexes can be beneficial if you are using a dynamic schema. | ||||||||||||
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. Suggestion:
Suggested change
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. Also not passive voice 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. You're right, thanks for the correction! |
||||||||||||
|
||||||||||||
The following example creates an ascending wildcard index on all | ||||||||||||
values of the ``location`` field, including values nested in subdocuments and arrays: | ||||||||||||
Comment on lines
+407
to
+408
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. Issue: I could be wrong, but I think the terminology is usually used when creating an index is to specify that it is on the field rather than the value. For example, see the headings on the createIndex Server Manual page. Each of the headings mentions "Create an Index on... Field". The action MongoDB takes is to index the values for the fields. Suggestion:
Suggested change
|
||||||||||||
|
||||||||||||
.. literalinclude:: /includes/fundamentals/code-snippets/IndexPage.java | ||||||||||||
:language: java | ||||||||||||
:dedent: | ||||||||||||
:start-after: begin wildcard index | ||||||||||||
:end-before: end wildcard index | ||||||||||||
|
||||||||||||
For more information, see the :manual:`Wildcard Indexes</core/index-wildcard>` page in the {+mdb-server+} manual. | ||||||||||||
|
||||||||||||
.. _java-clustered-indexes: | ||||||||||||
|
||||||||||||
Clustered Indexes | ||||||||||||
|
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.
Suggestion:
I think it would be good to avoid passive voice unless it makes it sound like you are blaming the user (style guide). I see that this sentence is verbatim from the Server Manual page, but I think that wasn't a particularly good sentence (and given the 4.2 release note, it was probably written ~5-6 years ago prior to authoring or adopting the style guide).
Avoid I think "arbitrary" usually carries a negative connotation and that it is not that accurate. The fields actually need to follow the pattern that you define (whether the pattern is all fields, nested fields, or multiple specific fields.
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 isn't passive voice...?
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.
You're right, thanks for the correction!