Different TTL expiration per environment #510
-
What product are you having troubles with?Console What Console version are you using?v12.0.2 DescriptionIt is possible in some way to define different TTL expire seconds based on the environment? Thanks Actual OutcomeNo response Expected OutcomeNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @elmalakomar From the Console, it is only possible to specify a numeric value within the TTL form, so is not possible to use handlebar syntax. However, keep in mind that TTL indexes should be used with collections having a small size of documents due to their performances: when a collection has a great number of records, the deletion procedure triggered by the TTL expiration may happen during a peak of activity within your MongoDB cluster, slowing other operations happening. Also, always from the MongoDB docs mentioned, TTL constraints are executed on the cluster every 60 seconds. @albertotessarotto maybe we should consider adding a warning about TTL indexes on our docs. So, if your use case falls into this category, you may use a cronjob that performs the deletion periodically during hours when the database is not used by other processes (for example, at midnight). In that case, using the cronjob section of the Console, you can use handlebars to change scheduling time according to your environment. |
Beta Was this translation helpful? Give feedback.
Hi @elmalakomar
From the Console, it is only possible to specify a numeric value within the TTL form, so is not possible to use handlebar syntax.
However, keep in mind that TTL indexes should be used with collections having a small size of documents due to their performances: when a collection has a great number of records, the deletion procedure triggered by the TTL expiration may happen during a peak of activity within your MongoDB cluster, slowing other operations happening.
Also, always from the MongoDB docs mentioned, TTL constraints are executed on the cluster every 60 seconds.
@albertotessarotto maybe we should consider adding a warning about TTL indexes on our docs.
So, if your us…