beanie icon indicating copy to clipboard operation
beanie copied to clipboard

Init TimeSeries Collections

Open acrozes opened this issue 3 years ago • 1 comments

Hello,

How to create TimeSeries Collection ? https://docs.mongodb.com/manual/core/timeseries-collections/#create-a-time-series-collection

The mongo query as exemple:

db.createCollection(
  "weather24h",
  {
    timeseries: {
      timeField: "timestamp",
      metaField: "metadata",
      granularity: "hours"
    },
    expireAfterSeconds: 86400
  }
)

acrozes avatar Sep 24 '21 22:09 acrozes

Hey @acrozes ,

Thank you for the issue. Unfortunately, timeseries collection creation is not supported by Beanie yet. You can create it manually using motor syntax: https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_database.html?highlight=create_collection#motor.motor_asyncio.AsyncIOMotorDatabase.create_collection And then use the collection name in the model Collection inner class.

It will be supported soon, but I have to finish some big updates before. I'll inform you here when it will be supported.

roman-right avatar Sep 27 '21 12:09 roman-right

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Mar 23 '23 02:03 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Apr 07 '23 02:04 github-actions[bot]