spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Add support for collection expiration to @TimeSeries.

Open bpfoster opened this issue 2 years ago • 4 comments

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 or expire 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 both expireAterSeconds and expire are defined. expire allows all the same expressions as are supported on @Indexed.

Closes #4099

  • [x] You have read the Spring Data contribution guidelines.
  • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [x] You submit test cases (unit or integration tests) that back your changes.
  • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

bpfoster avatar Jul 14 '22 18:07 bpfoster

@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.

pivotal-cla avatar Jul 14 '22 18:07 pivotal-cla

@bpfoster Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Jul 14 '22 18:07 pivotal-cla

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.

christophstrobl avatar Jul 27 '22 09:07 christophstrobl

Update - there's a PR (spring-projects/spring-framework#30396) targeting FW 6.1 timeframe.

christophstrobl avatar Jul 17 '23 14:07 christophstrobl