Closed IProudNoob closed 1 year ago
You can create advanced indexes by referencing pymongo.IndexModel
directly:
https://roman-right.github.io/beanie/tutorial/indexes-%26-collection-names/#multi-field-indices
For example, if you wanted to create a partial index:
class Settings:
indexes = [
IndexModel(
[("email", ASCENDING)],
name="email_unique_if_not_empty",
unique=True,
partialFilterExpression={"email": {"$type": "string"}},
),
If you can create the index you seek with IndexModel
, you can do the same with Beanie:
https://pymongo.readthedocs.io/en/stable/api/pymongo/operations.html#pymongo.operations.IndexModel
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.
Hello! It is possible to add TTL to the index?
THX!