Skip to content
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

Merged
merged 5 commits into from Jun 19, 2023

Conversation

rumyantseva
Copy link
Member

@rumyantseva rumyantseva commented Jun 19, 2023

Description

Closes #2045.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@rumyantseva rumyantseva added the documentation Something user-visible is badly or not documented label Jun 19, 2023
@rumyantseva rumyantseva requested a review from AlekSi as a code owner June 19, 2023 08:23
@rumyantseva rumyantseva self-assigned this Jun 19, 2023
@rumyantseva rumyantseva enabled auto-merge (squash) June 19, 2023 08:24
Copy link
Member

@AlekSi AlekSi left a 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

@AlekSi AlekSi added this to the v1.4.0 milestone Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #2856 (1e57e8a) into main (d38ab72) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2856   +/-   ##
=======================================
  Coverage   63.77%   63.77%           
=======================================
  Files         448      448           
  Lines       22890    22890           
=======================================
  Hits        14598    14598           
  Misses       7334     7334           
  Partials      958      958           
Flag Coverage Δ
integration 56.84% <ø> (ø)
mongodb 4.26% <ø> (ø)
pg 56.75% <ø> (ø)
shard-1 43.53% <ø> (ø)
shard-2 41.23% <ø> (ø)
shard-3 42.55% <ø> (ø)
unit 24.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@rumyantseva rumyantseva changed the title Update user documentation about unique index creation support Add user documentation about unique index creation Jun 19, 2023
@rumyantseva rumyantseva requested a review from AlekSi June 19, 2023 08:48
```js
db.products.createIndex({ category: 1, name: 1 }, { unique: true })
```

:::note
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member Author

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

@rumyantseva rumyantseva requested a review from AlekSi June 19, 2023 08:52
db.products.createIndex({ category: 1, name: 1 }, { unique: true })
```

### Index creation details
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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

Copy link
Member

@Fashander Fashander left a comment

Choose a reason for hiding this comment

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

Added some comments

@AlekSi AlekSi disabled auto-merge June 19, 2023 12:18
@AlekSi AlekSi merged commit 2e5997c into FerretDB:main Jun 19, 2023
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Something user-visible is badly or not documented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement createIndexes for unique indexes
3 participants