Skip to content

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

Open
@gbaso

Description

@gbaso

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions