Hi all,
I am using timeseries collection to store sensor data defined/create as below
database.CreateCollection("SensorData",
new CreateCollectionOptions { TimeSeriesOptions = new TimeSeriesOptions("Timestamp", metaField: "SensorId", granularity: TimeSeriesGranularity.Seconds), ExpireAfter = TimeSpan.FromDays(365) });
As per the above syntax am expecting the document in the collection to be deleted after one year they were created.
Now due to certain requirements I want to change ExpireAfter to 2 years so the documents will auto deleted after 2 years since . how can I achieve this functionality in C#.
Any help will be appreciated .
Thanks