Skip to content

Support for MongoDB TimeSeries expireAfterSeconds #4099

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
Kruschenstein opened this issue Jul 1, 2022 · 1 comment
Closed

Support for MongoDB TimeSeries expireAfterSeconds #4099

Kruschenstein opened this issue Jul 1, 2022 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@Kruschenstein
Copy link

Hello 🙂

Spring-data-mongodb supports TimeSeries since version 3.3. It allows to declare and create new timeseries collection. The @TimeSeries annotation offers many parameters such as those which are in the sub-object timeseries, (timeField, metaField and granularity). But there is no support for a field that comes with the TimeSeries arrival which is expireAfterSeconds (time series collections).

Regarding the code the CollectionOptions class, there is no field corresponding to expireAfterSeconds. Then if we want to create a time series with automatic expiration period, we must bypass the Spring classes and annotations (that's sad 🙁).

Is a support for the expireAfterSeconds planned for @TimeSeries? If not, I suggest to add the option to @TimeSerie annotation only. As mentionned in documentation:
expiredAfterSeconds

Optional. Enable the automatic deletion of documents in a time series collection by specifying the number of seconds after which documents expire. MongoDB deletes expired documents automatically.

(therefore, I don't understand why this option is not part of timeseries sub-object...)

I hope this proposal will interest you
Regards

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 1, 2022
bpfoster added a commit to bpfoster/spring-data-mongodb that referenced this issue Jul 14, 2022
bpfoster added a commit to bpfoster/spring-data-mongodb that referenced this issue Jul 14, 2022
@gbaso
Copy link
Contributor

gbaso commented Apr 4, 2024

Is there any progress on this issue? Automatic expiration on time series is an important feature and it would be great to have spring support.

@christophstrobl christophstrobl added this to the 4.4 M1 (2024.1.0) milestone Sep 6, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 16, 2024
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.

5 participants