Skip to content

How to create TTL index but with different expire time for every document #743

Closed Answered by kennarddh
kennarddh asked this question in Question
Discussion options

You must be logged in to vote

I can do this by using

class Settings:
    name = "x"
    indexes = [
        IndexModel(
            'expire_at',
            name="expire_ttl",
            expireAfterSeconds=0
        ),
    ]

The expire_at field type is datetime.datetime

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kennarddh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant