Skip to content

Allow to specify index for query by MongoRepository [DATAMONGO-2373] #3230

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
spring-projects-issues opened this issue Sep 18, 2019 · 0 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

huantt opened DATAMONGO-2373 and commented

Please allow to specify index for query by MongoRepository


No further details from DATAMONGO-2373

@spring-projects-issues spring-projects-issues added the type: enhancement A general enhancement label Dec 30, 2020
christophstrobl added a commit that referenced this issue Mar 21, 2023
This commit introduces the new `@Hint` annotation that allows to override MongoDB's default index selection for repository query, update and aggregate operations.

```
@hint("lastname-idx")
List<Person> findByLastname(String lastname);

@query(value = "{ 'firstname' : ?0 }", hint="firstname-idx")
List<Person> findByFirstname(String firstname);
```

Closes: #3230
mp911de added a commit that referenced this issue Apr 13, 2023
Reformat code. Make getAnnotatedHint non-nullable.

See #3230
Original pull request: #4339
@mp911de mp911de added this to the 4.1 RC1 (2023.0.0) milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants