Module spring.data.mongodb
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 TypeMethodDescriptionbooleangranularity(GranularityDefinition granularity) Select theGranularityDefinitionparameter to define how data in the time series collection is organized.inthashCode()Set the name of the field which contains metadata in each time series document.timeSeries(String timeField) Create a new instance ofCollectionOptions.TimeSeriesOptionsusing the given field as its timeField.toString()
-
Method Details
-
timeSeries
Create a new instance ofCollectionOptions.TimeSeriesOptionsusing the given field as its timeField. The one, that contains the date in each time series document.
Annotated fieldnameswill 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 fieldnameswill be considered during the mapping process.- Parameters:
metaField- must not be null.- Returns:
- new instance of
CollectionOptions.TimeSeriesOptions.
-
granularity
Select theGranularityDefinitionparameter 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:
-
getTimeField
- Returns:
- never null.
-
getMetaField
- Returns:
- can be null. Might be an empty
Stringas well, so maybe check viaStringUtils.hasText(String).
-
getGranularity
- Returns:
- never null.
-
toString
-
equals
-
hashCode
public int hashCode()
-