Hey everyone, big MongoDB fan here.
Using Beanie object-mapper for Python.
A lot of my collections are time series, therefore I use the time series settings when creating a collection:
class SampleTimeSeries(Document): ts: datetime = Field(default_factory=datetime.now) meta: str class Settings: timeseries = TimeSeriesConfig( time_field="ts", # Require )
However, I would like to create a collection of these time series collection. Can I do this? If so, what is the easiest way? The example I give below assumes the “timeseries_a” field to be a single document when I try this way.
class CollectionOfTimeSeries(Document): timeseries_a: SampleTimeSeries timeseries_b: SampleTimeSeries