Add

interface Add

The Add clause may be used to update numbers and add elements to sets. See the low-level DynamoDB documentation for more details on the underlying features and capabilities.

Number values and set elements may be added by using the += operator (or the plusAssign method):

add {
attr["foo"] += 15 // Increments the value of attribute `foo` by `15`
attr["bar"] += -15 // Decrements the value of attribute `foo` by `15`
attr["baz"] += setOf("a", "b", "c") // Adds the elements `["a", "b", "c"]` to the attribute `baz`
}

Properties

Link copied to clipboard
abstract val attr: Attr

Accesses an attribute path reference from a top-level attribute name in this update expression (e.g., attr["foo"] references the "foo" attribute of items being updated)

Functions

Link copied to clipboard
abstract operator fun AttributePath.plusAssign(value: Expression)
open operator fun AttributePath.plusAssign(value: Number)
open operator fun AttributePath.plusAssign(value: UByte)
open operator fun AttributePath.plusAssign(value: UInt)
open operator fun AttributePath.plusAssign(value: ULong)
open operator fun AttributePath.plusAssign(value: UShort)
@JvmName(name = "plusAssignSetNumber")
open operator fun <N : Number> AttributePath.plusAssign(value: Set<N>)
@JvmName(name = "plusAssignSetByteArray")
open operator fun AttributePath.plusAssign(value: Set<ByteArray>)
@JvmName(name = "plusAssignSetString")
open operator fun AttributePath.plusAssign(value: Set<String>)
@JvmName(name = "plusAssignSetUByte")
open operator fun AttributePath.plusAssign(value: Set<UByte>)
@JvmName(name = "plusAssignSetUInt")
open operator fun AttributePath.plusAssign(value: Set<UInt>)
@JvmName(name = "plusAssignSetULong")
open operator fun AttributePath.plusAssign(value: Set<ULong>)
@JvmName(name = "plusAssignSetUShort")
open operator fun AttributePath.plusAssign(value: Set<UShort>)

Adds an update instruction to update this numerical attribute or to add an element to this set