Skip to content

Introduce explicit index field matching methods - #5192

Open
DragonFSKY wants to merge 1 commit into
spring-projects:mainfrom
DragonFSKY:GH-5187
Open

Introduce explicit index field matching methods#5192
DragonFSKY wants to merge 1 commit into
spring-projects:mainfrom
DragonFSKY:GH-5187

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented May 5, 2026

Copy link
Copy Markdown

Closes #5187

Keeps the existing subset-matching behavior for compatibility, deprecates the ambiguous method, and adds explicit methods for:

  • subset matching regardless of position
  • exact field-name matching regardless of order
  • compound-index prefix coverage

The internal index assertion now uses the explicit subset method.

Validation:

  • ./mvnw -pl spring-data-mongodb -Dtest=IndexInfoUnitTests clean test (14 tests passed)

Checklist:

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided by the project and have not submitted unrelated formatting changes.
  • You submit test cases that back your changes.
  • You added yourself as author in the headers of the classes you touched.

Closes spring-projects#5187

Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexInfo::isIndexForFields returns false positives

3 participants