Options
All
  • Public
  • Public/Protected
  • All
Menu

Object passed into all Update.Resolver functions to support getting path and value aliases, appending update conditions to SET, REMOVE, ADD and DELETE update arrays and provide context to the resolver function to support advanced update resolvers.

Hierarchy

  • UpdateExpression

Implements

Index

Constructors

Properties

addList: string[] = []

Array of ADD expressions.

Object to support getting path and value aliases.

deleteList: string[] = []

Array of DELETE expressions.

removeList: string[] = []

Array of REMOVE expressions.

setList: string[] = []

Array of SET expressions.

Methods

  • addAdd(value: string): void
  • Append an ADD update expression.

    Parameters

    • value: string

      Expression to add to the ADD array.

    Returns void

  • addDelete(value: string): void
  • Append an DELETE update expression.

    Parameters

    • value: string

      Expression to add to the DELETE array.

    Returns void

  • addPath(name: string): string
  • addRemove(value: string): void
  • Append a REMOVE update expression.

    Parameters

    • value: string

      Expression to add to the REMOVE array.

    Returns void

  • addSet(value: string): void
  • Append a SET update expression.

    Parameters

    • value: string

      Expression to add to the SET array.

    Returns void

  • getExpression(): string | void
  • Helper method to build an UpdateExpression string appending all of the expressions from the lists that are not empty.

    Returns string | void

    UpdateExpression based string.

  • Resolves each key of a map to an Update.Expression.

    Parameters

    • map: ResolverMap

      Map of update values and resolvers to evaluate.

    • Optional name: string

      Name alias of the parent attribute, prepends each key name

    Returns void

  • Helper method used in update methods that do not support string attributes, like add or sub. This then allows string values to act as paths, without having to wrap the path in a resolver. For strings based attributes, like set, need to use the path() function to wrap the path.

    Parameters

    • value: OperandValue<Table.AttributeValues>

      The value, update resolver or path string to add and get back an alias.

    • name: string

      Name used to pass down to the value resolver.

    Returns string

    Alias or expression for value to use in expression.

  • Add value or resolve value function to get back alias or resolved string. To allow the value to reference a path, the value needs to be a resolver.

    Parameters

    Returns string

    Alias or expression for value to use in expression.

  • Helper function to set a 'UpdateExpression' value on the params argument if there are update expressions to resolve.

    Parameters

    • params: { UpdateExpression?: string }

      Params used for DocumentClient update method.

      • Optional UpdateExpression?: string
    • attributes: Table.ExpressionAttributes
    • Optional updateMap: ResolverMap

      Map of update values and resolvers to evaluate.

    Returns void

    The params argument passed in.

  • Helper function that resolves the updateMap and returns an UpdateExpression to use in DocumentClient.update method calls.

    Parameters

    • updateMap: ResolverMap

      Map of update values and resolvers to evaluate.

    • exp: Update.Expression

      Used when calling update resolver function to store the names and values mappings and update expressions.

    Returns string | void

    Update expression to use in UpdateExpression for DocumentClient.update method calls.

Generated using TypeDoc