-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for collection expiration to @TimeSeries. #4114
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
Add support for collection expiration to @TimeSeries. #4114
Conversation
@bpfoster Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@bpfoster Thank you for signing the Contributor License Agreement! |
Thank you @bpfoster! To avoid the duplication in parsing the duration we're waiting for spring-projects/spring-framework#22474 to land in Framework 6 before bringing the changes in. Thanks for your understanding and patience. |
Update - there's a PR (spring-projects/spring-framework#30396) targeting FW 6.1 timeframe. |
Switch to Spring Framework duration formatting. Favour expireAfter with string parameter over the seconds based variant. Deprecate the existing expireAfterSeconds attribute of the Indexed annotation. Consider property value syntax when parsing timeout expressions. Remove DurationStyle (package visible). Update documentation. Original Pull Request: #4114
Thank you @bpfoster for the contribution and your patience. Merged to main development line. |
Original Pull Request: #4114
This will allow setting up automatic removal for time series collections (https://www.mongodb.com/docs/manual/core/timeseries/timeseries-automatic-removal/#set-up-automatic-removal-for-time-series-collections--ttl-), by adding an
expireAfterSeconds
orexpire
element to the@TimeSeries
annotation.Similar to
@Indexed
,expireAfterSeconds
on will have a default of-1
, and will not be used if it is <= 0. An error will be thrown if bothexpireAterSeconds
andexpire
are defined.expire
allows all the same expressions as are supported on@Indexed
.Closes #4099