Class CollectionOptions.TimeSeriesOptions
java.lang.Object
org.springframework.data.mongodb.core.CollectionOptions.TimeSeriesOptions
- Enclosing class:
- CollectionOptions
Options applicable to Time Series collections.
- Since:
- 3.3
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
expireAfter
(Duration ttl) Set theDuration
for automatic removal of documents older than a specified value.Get theDuration
for automatic removal of documents.granularity
(GranularityDefinition granularity) Select theGranularityDefinition
parameter to define how data in the time series collection is organized.int
hashCode()
Set the name of the field which contains metadata in each time series document.timeSeries
(String timeField) Create a new instance ofCollectionOptions.TimeSeriesOptions
using the given field as its timeField.toString()
-
Method Details
-
timeSeries
Create a new instance ofCollectionOptions.TimeSeriesOptions
using the given field as its timeField. The one, that contains the date in each time series document.
Annotated fieldnames
will be considered during the mapping process.- Parameters:
timeField
- must not be null.- Returns:
- new instance of
CollectionOptions.TimeSeriesOptions
.
-
metaField
Set the name of the field which contains metadata in each time series document. Should not be the id nortimeSeries(String)
timeField} nor point to an array orCollection
.
Annotated fieldnames
will be considered during the mapping process.- Parameters:
metaField
- must not be null.- Returns:
- new instance of
CollectionOptions.TimeSeriesOptions
.
-
granularity
Select theGranularityDefinition
parameter to define how data in the time series collection is organized. Select one that is closest to the time span between incoming measurements.- Returns:
- new instance of
CollectionOptions.TimeSeriesOptions
. - See Also:
-
expireAfter
Set theDuration
for automatic removal of documents older than a specified value.- Parameters:
ttl
- must not be null.- Returns:
- new instance of
CollectionOptions.TimeSeriesOptions
. - Since:
- 4.4
- See Also:
-
CreateCollectionOptions.expireAfter(long, java.util.concurrent.TimeUnit)
-
getTimeField
- Returns:
- never null.
-
getMetaField
- Returns:
- can be null. Might be an empty
String
as well, so maybe check viaStringUtils.hasText(String)
.
-
getGranularity
- Returns:
- never null.
-
getExpireAfter
Get theDuration
for automatic removal of documents.- Returns:
- a
negative
value if not specified. - Since:
- 4.4
-
toString
-
equals
-
hashCode
public int hashCode()
-