-
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
Docsp 26803 adding wildcard code example #405
Conversation
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
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
* DOCSP-22622 Changed default visibility for code blocs so they are hidden * DOCSP-26803 - Add wildcard code example. * autobuilder --------- Co-authored-by: Caitlin Davey <[email protected]> (cherry picked from commit d1ae4c7)
|
||
.. _wildcard-indexes: | ||
|
||
Wildcard indexes enable queries against unknown or arbitrary 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.
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.
Wildcard indexes enable queries against unknown or arbitrary fields. | |
You can use wildcard indexes to instruct MongoDB to index all field names that match a pattern. |
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!
.. _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 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, per the style guide.
-
I know the Server Manual mentions "dynamic schemas", but that is jargon that I think could be avoided or explained.
These indexes can be beneficial if you are using a dynamic schema. | |
You can use these indexes when you need to match a set of fields based on the field names, specific subdocuments or arrays, and where they are located in the document schema. |
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.
Also not 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!
The following example creates an ascending wildcard index on all | ||
values of the ``location`` field, including values nested in subdocuments and arrays: |
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.
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:
The following example creates an ascending wildcard index on all | |
values of the ``location`` field, including values nested in subdocuments and arrays: | |
The following code example shows how you can create an ascending | |
wildcard index to instruct MongoDB to index values of the \`\`location\`\` | |
field, and all values nested in subdocuments and arrays: |
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-26803
Staging - https://docs-mongodbcom-staging.corp.mongodb.com/java/docsworker-xlarge/DOCSP-26803-adding-wildcard-code-example/fundamentals/indexes/#wildcard-indexes
Self-Review Checklist