TimeseriesOptions

public struct TimeseriesOptions : Codable

The options to use when creating a time series collection.

  • Name of the top-level field to be used for time. Inserted documents must have this field, and the field must be of the BSON UTC datetime type.

    Declaration

    Swift

    public var timeField: String
  • Name of the top-level field describing the series. This field is used to group related data and may be of any BSON type except array. This name must not be the same as the timeField or _id.

    Declaration

    Swift

    public var metaField: String?
  • The units used to describe the expected interval between subsequent measurements for a time series collection. Defaults to Granularity.seconds if unset.

    Declaration

    Swift

    public var granularity: Granularity?
  • The units used to describe the expected interval between subsequent measurements for a time series collection.

    See more

    Declaration

    Swift

    public struct Granularity : RawRepresentable, Codable