Skip to content

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

Conversation

caitlindavey
Copy link
Collaborator

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

  • 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?

@caitlindavey caitlindavey requested a review from mongoKart May 18, 2023 15:11
Copy link
Contributor

@mongoKart mongoKart left a comment

Choose a reason for hiding this comment

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

LGTM

@caitlindavey caitlindavey merged commit d1ae4c7 into mongodb:master May 18, 2023
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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)
caitlindavey added a commit that referenced this pull request May 18, 2023
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:

  1. 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).

  2. 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.

Suggested change
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.

Copy link
Contributor

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...?

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Suggestion:

  1. I think it would be good to avoid passive voice, per the style guide.

  2. I know the Server Manual mentions "dynamic schemas", but that is jargon that I think could be avoided or explained.

Suggested change
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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also not passive voice

Copy link
Contributor

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!

Comment on lines +407 to +408
The following example creates an ascending wildcard index on all
values of the ``location`` field, including values nested in subdocuments and arrays:
Copy link
Contributor

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:

Suggested change
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:

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