beanie
beanie copied to clipboard
Init TimeSeries Collections
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
}
)
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.
This issue is stale because it has been open 30 days with no activity.
This issue was closed because it has been stalled for 14 days with no activity.