Skip to content

Can't (still) use properties in @Indexed#expireAfter #4980

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

Open
gbaso opened this issue May 23, 2025 · 1 comment
Open

Can't (still) use properties in @Indexed#expireAfter #4980

gbaso opened this issue May 23, 2025 · 1 comment
Assignees
Labels
type: enhancement A general enhancement

Comments

@gbaso
Copy link
Contributor

gbaso commented May 23, 2025

Following #4672, #2369 and Spring Data 2024.0 Release, I expected to be able to use property placeholders in @Indexed#expireAfter.

However, this is still not possible. SpEL expressions #{...} work, as well as bean references #{@bean.method()}, but using properties ${...} results in an exception: '${ttl}' is not a valid duration, cannot detect any known style.

Minimal sample: https://github.com/gbaso/spring-data-mongodb-ttl.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 23, 2025
@christophstrobl christophstrobl self-assigned this May 23, 2025
@christophstrobl christophstrobl added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 23, 2025
@christophstrobl
Copy link
Member

thanks for the heads up, seems we'd need to obtain the ValueEvaluationContext in MongoPersistentEntityIndexResolver:663 instead of just the EvaluationContext.

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

No branches or pull requests

3 participants