prorm API Reference
    Preparing search index...

    Interface RetentionPolicyOptions

    interface RetentionPolicyOptions {
        maxAge: RetentionDuration;
        field?: string;
        onExpiry?: RetentionExpiryMode;
        preserveFields?: string[];
    }
    Index

    Maximum age of records to keep. Records older than this will be purged.

    field?: string

    The date field used to determine record age. Default: 'createdAt'

    What to do when a record expires. 'delete' — hard delete the row (default) 'anonymize' — set all string/non-id fields to null

    preserveFields?: string[]

    Fields to preserve during anonymization (only relevant when onExpiry='anonymize'). Primary key and the date field are always preserved.