Skip to content

Add annotation @IgnoreIndexes #4600

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

Closed
wants to merge 1 commit into from

Conversation

rolag-it
Copy link
Contributor

Allow to ignore indexes defined on class of properties when mapped as embedded document

See: #2836

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Allow to ignore indexes defined on class of properties when mapped as embedded document

See: spring-projects#2836
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 28, 2023
@mp911de mp911de linked an issue Dec 29, 2023 that may be closed by this pull request
@rolag-it
Copy link
Contributor Author

rolag-it commented Jan 2, 2024

The currently implemented resolution of annotation-based indexes for properties mapped as embedded document is quite odd resulting counter-intuitive and bug prone.

The new annotation @IgnoreIndexes allows to exclude unwanted indexes definitions when mapping embedded document; it is a low footprint, no side-effects, totally backward compatible solution that enables great flexibility to annotation-based indexes.

Also it facilitates the embedded document pattern, a key approach for mapping relation in MongoDB.

@mp911de mp911de added the for: team-attention An issue we need to discuss as a team to make progress label Jan 3, 2024
@christophstrobl
Copy link
Member

Thank you @rolag-it for taking the time to look into this issue and create the PR!
I second @mp911de recent comment on #2836 regarding use of indexing annotations and do not think adding more annotations is the way to go here.

@christophstrobl christophstrobl added unlikely and removed for: team-attention An issue we need to discuss as a team to make progress labels Jan 9, 2024
@mp911de mp911de added status: declined A suggestion or change that we don't feel we should currently apply and removed unlikely status: waiting-for-triage An issue we've not yet triaged labels Jan 9, 2024
@mp911de mp911de closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexed affects not only root collection [DATAMONGO-1965]
4 participants