-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add user documentation about unique index creation #2856
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.
Please add an example or update the existing one in indexes.md
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2856 +/- ##
=======================================
Coverage 63.77% 63.77%
=======================================
Files 448 448
Lines 22890 22890
=======================================
Hits 14598 14598
Misses 7334 7334
Partials 958 958
Flags with carried forward coverage won't be shown. Click here to find out more. |
website/docs/indexes.md
Outdated
```js | ||
db.products.createIndex({ category: 1, name: 1 }, { unique: true }) | ||
``` | ||
|
||
:::note |
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.
That note does not really belong to that section.
Please update the documentation, not just insert your own bit
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 note doesn't belong to compound indexes either. It's rather for the whole index creation section. Do you have a suggestion where it should be moved?
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.
No, but I know that it should not be there. It was wrong too and is wrong now after insertion
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.
Does it look better now (as a separate section)?
db.products.createIndex({ category: 1, name: 1 }, { unique: true }) | ||
``` | ||
|
||
### Index creation details |
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.
@rumyantseva A separate section may be quite confusing since we have one on how to create indexes
. Let's add this to the section above on how to create 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.
It can be a subsection there too or just as extra details after this sentence You can create single field indexes 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.
"Index creation details" is a subsection of "How to create indexes", not a top-level section
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.
@Fashander Please send a new PR to improve that page if needed
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.
Added some comments
Description
Closes #2045.
Readiness checklist
task all
, and it passed.@FerretDB/core
), Labels, Project and project's Sprint fields.