-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-41986: multikey indexes #140
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-41986: multikey indexes #140
Conversation
✅ Deploy Preview for docs-php-library ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
One non-blocking suggestion but LGTM!
source/indexes/multikey-index.txt
Outdated
**Multikey indexes** are indexes that improve the performance of queries | ||
on array-valued fields. You can create a multikey index on a collection | ||
by using the ``MongoDB\Collection::createIndex()`` method and the same | ||
syntax that you use to create single field or compound 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.
S: Might be helpful to link to the single field and compound index pages as you mention them here
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 with suggested whitespace change.
If looks like that was also missed in #134 so you can change the other json_encode()
line as well for consistency.
source/includes/indexes/indexes.php
Outdated
$document = $collection->findOne( | ||
['cast' => ['$in' => ['Aamir Khan', 'Kajol']]] | ||
); | ||
echo json_encode($document) , PHP_EOL; |
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.
In the index landing PR (#127), I suggested using some driver functions to print the value as extended JSON. It looks like that was missed in a subsequent PR for single field indexes (#134), upon which I expect this was based.
I'll defer to you if it's worth changing. The expected output in the RST doesn't show any special BSON types, so it's probably of little consequence.
echo json_encode($document) , PHP_EOL; | |
echo json_encode($document), PHP_EOL; |
No need for preceding whitespace for a comma. It would be appropriate for a concatenation operator (dot), though.
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.
I think it's ok to use the simpler json_encode()
method in these contexts. I will change the whitespace though!
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-41986
Staging - https://preview-mongodbrustagir.gatsbyjs.io/php-library/DOCSP-41986-multikey-indexes/indexes/multikey-index/
Self-Review Checklist