DATE Criteria
Parent: Archive Rules · Published reference · snapshot 2026-09-30
↓ Facts as markdownall context files
Source-anchored research for DATE Criteria. Run status: COMPLETED.
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.
Definitions
- ISODATE is the default date format for DATE criteria in MongoDB Atlas Online Archive. (high confidence) [source]
Structure and components
- OBJECT_ID format extracts the embedded date component from MongoDB ObjectId for archival matching (high confidence) [source]
- Queries that omit partition fields or query fields not included in the partition structure require a full collection scan of all archived documents, increasing latency and costs. (high confidence) [source]
How it works
- ISODATE (ISO 8601 format) is the default date_format when not explicitly specified in archive configuration (low confidence) [source]
- When using DATE criteria type, you must set type to DATE if collection_type is TIMESERIES. (low confidence) [source]
- Using $expr with $toDate on $_id to extract dates from ObjectIds during archiving causes full collection scans and should be avoided for performance reasons. (low confidence) [source]
- Using $expr operators in Custom Criteria filters may cause Atlas cluster behavior or performance issues. (low confidence) (verified as of 2026-09-30) [source]
- Some practitioners recommend Custom Criteria over DATE because it can be edited after creation. (low confidence) (verified as of 2026-09-30) [source]
- MongoDB Atlas Online Archive calculates document age using the formula: current_date > dateField + expireAfterDays. When this condition is true, documents are nominated for archival. (high confidence) [source]
- MongoDB Atlas distinguishes between criteria.expireAfterDays and dataExpirationRule.expireAfterDays. criteria.expireAfterDays determines archival eligibility (when data moves to the online archive), while dataExpirationRule.expireAfterDays specifies when data should be deleted from the archive (purge). The bounds of 7 to 9215 days apply to dataExpirationRule.expireAfterDays, not to criteria.expireAfterDays. (high confidence) [source]
- When using DATE criteria, the date_field value must be included in the partition_fields configuration. The date field defaults as the first partition item. (high confidence) [source]
- Atlas Data Federation can query archived data stored in S3 when partition fields are specified. Queries matching partition fields avoid full collection scans, reducing cost and improving performance. (high confidence) [source]
- When using DATE criteria, a maximum of three partition fields are allowed: the date field plus up to two additional commonly-queried fields. (high confidence) [source]
- Supported partition attribute types are: date, double, int, long, objectId, string, boolean, and uuid; however UUID is not optimized for queries and may result in high latency. (high confidence) [source]
Problems, failure modes and limitations
- The date field used for archival criteria cannot be modified after the online archive is created (high confidence) [source]
- The date field must be indexed for optimal archiving performance; Atlas issues an Index Sufficiency Warning if the ratio of documents scanned to documents returned is 10 or more. (high confidence) [source]
- Once an online archive is created with DATE criteria, the date field cannot be modified—only the expireAfterDays value can be changed. (high confidence) [source]
- If the specified date_field does not exist in the collection, the online archive state will remain in 'Pending' status indefinitely and cannot be modified without destroying and recreating the resource. (low confidence) [source]
- Partition fields cannot be modified after an Online Archive is created; changing partition structure requires deleting the archive and creating a new one with the desired fields. (high confidence) [source]
- For DATE criteria, the date field itself cannot be changed once the archive is created; only the number of days (expire_after_days) can be modified. (high confidence) [source]
- Partition field values are limited to a maximum of 700 characters; documents with partition field values exceeding this limit are not archived. (high confidence) [source]
- Partition field names cannot contain periods (.), which prevents using dot notation within field names for partitioning. (high confidence) [source]
Comparisons and alternatives
- The expireAfterDays parameter in Atlas Online Archive DATE criteria is distinct from MongoDB TTL indexes which use expireAfterSeconds. These are separate mechanisms for different purposes: archiving vs deletion. (high confidence) [source]
Facts and statements
- MongoDB Atlas Online Archive DATE criteria supports exactly five date_format values: ISODATE, EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS, and OBJECT_ID (high confidence) [source]
- EPOCH_SECONDS, EPOCH_MILLIS, and EPOCH_NANOSECONDS represent Unix timestamps in seconds, milliseconds, and nanoseconds since epoch (1970-01-01 00:00:00 UTC) respectively (low confidence) [source]
- Time series collections only support ISODATE format; all other date formats are incompatible with time series archival (low confidence) [source]
- Epoch-based date formats require the source field to be BSON type 'long' (integer), not BSON type 'date' (low confidence) [source]
- OBJECT_ID format for date criteria does not utilize indexes during archival operations, potentially impacting performance (low confidence) [source]
- DATE criteria supports five date format types: ISODATE (ISO-8601 formatted date, default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS (all Unix epoch timestamps requiring BSON type long), and OBJECT_ID. (high confidence) [source]
- EPOCH_SECONDS, EPOCH_MILLIS, and EPOCH_NANOSECONDS formats require the date field value to be BSON type long. (high confidence) [source]
- Time series collections only support ISODATE format for the date field value in DATE criteria. (high confidence) [source]
- DATE criteria selects a single date field and an age in days; only the age parameter can be modified after archive creation, not the chosen date field. (high confidence) [source]
- Custom Criteria accepts standard MongoDB query filter expressions to define archival conditions. (high confidence) [source]
- Atlas continuously evaluates archival rules and transfers matching documents to the archive. (high confidence) [source]
- Custom Criteria examples can compare current timestamp against document date fields using $expr to define age-based rules. (medium confidence) [source]
- Atlas Online Archive DATE criteria supports multiple date formats: ISODATE (ISO 8601), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS, and OBJECT_ID. (high confidence) [source]
- Time series collections in Atlas Online Archive must use DATE criteria type; CUSTOM criteria is not supported for time series collection types. (high confidence) [source]
- For DATE criteria (Date Match), the date field used for archiving must be included as one of the partition fields and is positioned first by default in the partition path. (high confidence) [source]
- The order of partition fields is critical for query efficiency—queries must include all defined partition fields in their defined order to target specific partitions and minimize data scanned. (high confidence) [source]