@squidcloud/backend
    Preparing search index...

    Class MutationContext<T>

    The mutation context that will be provided to the security function.

    Type Parameters

    • T = any
    Index

    Accessors

    • get after(): undefined | T

      Returns the state of the document after the mutation was applied.

      Returns undefined | T

    • get before(): undefined | T

      Returns the state of the document before the mutation was applied.

      Returns undefined | T

    Methods

    • Find all affected paths starting from a root path.

      Parameters

      • startingRoot: string | Paths<T> = ''

      Returns Paths<T>[]

      doc before - { a: { b: 1, c: 2 }, d: 3 }
      doc after - { a: { b: 1, c: 3 }, d: 4 }
      doc.affectedPaths('a') // ['a.c']
    • Returns true if the mutation affects the provided path.

      Parameters

      • path: Paths<T>

      Returns boolean

    • Returns the type of the mutation (insert, update, or delete).

      Returns "delete" | "insert" | "update"

    Properties

    beforeAndAfterDocs: BeforeAndAfterDocs<T>
    mutation: Mutation<T>
    serverTimeStamp: Date