Class TimeSeriesOptions
Defines the time series options to use when creating a time series collection. See https://www.mongodb.com/docs/manual/reference/command/create/ for supported options and https://www.mongodb.com/docs/manual/core/timeseries-collections/ for more information on time series collections.
public class TimeSeriesOptions
- Inheritance
-
TimeSeriesOptions
- Inherited Members
Constructors
TimeSeriesOptions(string, Optional<string>, Optional<TimeSeriesGranularity?>)
Initializes a new instance of the TimeSeriesOptions class.
public TimeSeriesOptions(string timeField, Optional<string> metaField = default, Optional<TimeSeriesGranularity?> granularity = default)
Parameters
timeField
stringThe name of the top-level field to be used for time.
metaField
Optional<string>The name of the top-level field describing the series upon which related data will be grouped.
granularity
Optional<TimeSeriesGranularity?>The TimeSeriesGranularity for the time series.
Properties
Granularity
The coarse granularity of time series data.
public TimeSeriesGranularity? Granularity { get; }
Property Value
MetaField
The name of the field which contains metadata in each time series document.
public string MetaField { get; }
Property Value
TimeField
The name of the field which contains the date and time in each time series document.
public string TimeField { get; }
Property Value
Methods
ToBsonDocument()
The BSON representation of the time series options.
public BsonDocument ToBsonDocument()
Returns
- BsonDocument
A BsonDocument.