Libraries
    Preparing search index...

    Interface EntityEntry<T>

    Public view of a tracked entry, exposed via db.entry(entity).

    interface EntityEntry<T extends object> {
        currentValues: T;
        originalValues: Readonly<T>;
        state: EntryState;
        isModified(field?: keyof T): boolean;
        reset(): void;
    }

    Type Parameters

    • T extends object
    Index

    Properties

    currentValues: T

    Live object (same reference as the tracked entity).

    originalValues: Readonly<T>

    Snapshot of the values at the time the entity was last loaded/saved.

    state: EntryState

    Current state of the entry.

    Methods

    • Returns true when a specific field has changed since the last snapshot, or true when any field has changed when called without arguments.

      Parameters

      • Optionalfield: keyof T

      Returns boolean

    • Reset all changes to the snapshot values and transition state back to 'Unchanged' (or 'Added' if the entity was never persisted).

      Returns void