Archive Data Expiration Rule
Parent: Archive Rules · Published reference · snapshot 2026-10-15
↓ Facts as markdownall context files
Depth-first rabbithole dossier for Archive Data Expiration Rule; source-anchored research pack.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- [low] Data expires from the cluster after the period of time set in your rule based on the date field in the time series collection, and then stays in the archive for the period specified in the expiration rule based on when it was written to the archive, not the date field in the document. Sources: https://www.mongodb.com/community/forums/t/online-archive-dates/226846 [source]
- [high] In the `data_expiration_rule` block, the `expire_after_days` parameter is the number of days used in the date criteria for nominating documents for deletion, and the value must be between 7 and 9215. (In the `criteria` block, `expire_after_days` is the number of days after the `criteria.dateField` value when MongoDB Cloud archives data; the 7-9215 range is stated only for the deletion rule.) (verified as of 2026-10-15) Sources: https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://www.pulumi.com/registry/packages/mongo [source]
- [high] The `data_expiration_rule` is an optional rule for specifying when data should be deleted from the archive. Sources: https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://www.pulumi.com/registry/packages/mongodbatlas/api-docs/onlinearchive/, https://marketplace.upbound.io/providers/crossplane-contrib/provider-mongodbatlas/v1.4.1/resources/mongodbatlas.m.crossplane.io/OnlineArchive/v1alpha1 [source]
- [low] MongoDB Cloud archives data when the current date exceeds the date in the database parameter plus the number of days specified through the `expireAfterDays` parameter. Sources: https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md [source]
- [low] When the current date exceeds the value of the specified date field, Atlas subtracts the number of days from the current time and then archives data after that time. Sources: https://www.mongodb.com/docs/atlas/online-archive/overview.md [source]
Problems, failure modes and limitations
- [high] Once Atlas deletes archived data, you cannot recover it, so you must define your expiration rules carefully. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-time-series.md, https://www.mongodb.com/blog/post/enhancing-atlas-online-archive-data-expiration-scheduled-archiving [source]
- [low] You can leave the Data Retention Period field empty to disable the data expiration rule, and changes to the Deletion Age Limit take 24 hours to take effect. Sources: https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md [source]
- [low] The delete age limit allows the purging of data from archival storage based on required criteria and is an optional feature you can use as per your organization’s decision. Sources: https://foojay.io/today/atlas-online-archive-efficiently-manage-the-data-lifecycle/ [source]
Facts and statements
- [low] The `ONLINE_ARCHIVE_DATA_EXPIRATION_RULE_DISABLED`, `ONLINE_ARCHIVE_DATA_EXPIRATION_RULE_ENABLED`, `ONLINE_ARCHIVE_DATA_EXPIRATION_RULE_UPDATED`, and `ONLINE_ARCHIVE_DATA_EXPIRATION_RESOLVED` events indicate changes to the online archive data expiration rule. Sources: https://www.mongodb.com/docs/atlas/reference/atlas-alert-event-types.md [source]
- [medium] Atlas deletes archived data after the specified number of days, and this data expiration rule takes effect 24 hours after you set the Data Retention Period. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-time-series.md, https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md [source]
- [low] Expiration rules for online archives can be edited after creation if needed. Sources: https://www.mongodb.com/blog/post/enhancing-atlas-online-archive-data-expiration-scheduled-archiving [source]
- [high] The online archive data expiration feature is in preview and supports setting expiration from the archive as low as seven days and as high as 9,125 days via the Atlas UI or Admin API. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/atlas/release-notes/changelog.md, https://www.mongodb.com/blog/post/enhancing-atlas-online-archive-data-expiration-scheduled-archiving [source]
- [low] For example, if data is archived, it would stay in the archive for 180 days from the day it was archived. Sources: https://www.mongodb.com/community/forums/t/online-archive-dates/226846 [source]
- [low] Atlas evaluates online archive rules continuously and automatically transfers matching documents to cloud object storage managed by Atlas, such as AWS S3 or Azure Blob. Sources: https://www.mongodb.com/docs/atlas/online-archive/overview.md [source]
- [high] By default, Atlas does not delete archived data, but you can specify a Data Retention Period between 7 and 9,125 days (25 years) to keep archived data before deletion. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-time-series.md, https://www.mongodb.com/docs/atlas/online-archive/overview.md, https://www.mongodb.com/blog/post/enhancing-atlas-online-archive-data-expiration-scheduled-archiving [source]
- [low] The `ONLINE_ARCHIVE_DELETE_AFTER_DATE_UPDATED` event indicates that the online archive delete after date has been updated. Sources: https://www.mongodb.com/docs/atlas/reference/atlas-alert-event-types.md [source]
- The maximum value for the data retention period is stated as 9,125 days in some sources and 9,215 days in others. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-time-series.md, https://www.mongodb.com/docs/atlas/online-archive/overview.md, https://www.mongodb.com/blog/post/enhancing-atlas-online-archive-data-expiration-scheduled-archiving, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://www.pulumi [source]
Related concepts
- Data — is a part of Archive Data Expiration Rule
- Archive — is a part of Archive Data Expiration Rule
- Rule — is a part of Archive Data Expiration Rule
- Expiration — is a part of Archive Data Expiration Rule
Children
- No children recorded.