DATE vs CUSTOM criteria selection
Parent: DATE Criteria · Published reference · snapshot 2026-10-15
↓ Facts as markdownall context files
Depth-first rabbithole dossier for DATE vs CUSTOM criteria selection; 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] Custom filters are useful when data coldness is not purely based on age, such as when status is in terminal states and a closedAt field is old enough. Sources: https://dev.to/dvorlandi/atlas-online-archive-for-large-collections-keep-hot-data-hot-33fm [source]
Problems, failure modes and limitations
- [low] You cannot modify the archiving criteria from DATE to CUSTOM or vice versa once the online archive is created. Sources: https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md [source]
- [low] To edit DATE criteria, modify the number of days Atlas stores data on the active cluster in the Archival Age Limit section. Sources: https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md [source]
- [high] Custom queries do not support JavaScript expressions, and you cannot pass an empty document {} to return all documents. Sources: https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://www.pulumi.com/registry/packages/mongodbatlas/api-docs/onlinearchive/ [source]
Facts and statements
- [high] Atlas Online Archive supports two criteria types: DATE, which selects documents based on a date field and retention period, and CUSTOM, which selects documents using a custom JSON query. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/overview.md, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/internal/service/onlinearchive/resource.go, https: [source]
- [medium] For DATE criteria, Atlas archives documents once the current date exceeds the value of the date field plus the configured number of days (the overview describes this as subtracting the number of days from the current time and archiving data older than that point). Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/overview.md [source]
- [high] For CUSTOM criteria, Atlas runs the specified JSON query using the db.collection.find(query) command to select documents for archiving. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://www.mongodb.com/docs/atlas/online-archive/overview.md, https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md, https://www.pulumi.com/registry/packages/mongodbatlas/api-docs/onlinearchive/ [source]
- [low] To edit CUSTOM criteria, enter a valid JSON filter to select the documents for archiving. Sources: https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive.md [source]
- [low] For DATE-based rules, you can choose up to 3 partitioning keys in total, including the date field; for CUSTOM rules, you can choose up to 2 partitioning keys. Sources: https://www.mongodb.com/community/forums/t/atlas-online-archive-partition-based-on-timestamp/195506 [source]
- [high] The date field for DATE criteria is immutable once the online archive is created; if the date field value does not exist in the collection, the archive state remains pending forever and requires destruction to change. Sources: https://www.mongodb.com/docs/atlas/online-archive/configure-online-archive-standard.md, https://raw.githubusercontent.com/mongodb/terraform-provider-mongodbatlas/master/docs/resources/online_archive.md [source]
Related concepts
- CUSTOM — is a part of DATE vs CUSTOM criteria selection
- criteria — is a part of DATE vs CUSTOM criteria selection
- DATE — is a part of DATE vs CUSTOM criteria selection
Children
- No children recorded.