Skip to main content

DynamoDB Update Item


Terms

  • path: Item의 λ¬Έμ„œ 경둜 EX) user, info.name, #name
  • value: path에 λŒ€μž…ν•  κ°’ EX) :name
  • operand: path or value.

ConditionExpression

  • Comparator
    • a = b
    • a <> b: a와 bκ°€ λ‹€λ₯΄λ©΄ True
    • a < b
    • a <= b
    • a > b
    • a >= b
    • a BETWEEN b AND c: (b <= a) AND (a <= c)
    • a IN (b, c): (a = b) OR (a = c), λ¦¬μŠ€νŠΈλŠ” μ΅œλŒ€ 100개 κΉŒμ§€ μ„€μ •ν•  수 있음
  • Function
    • attribute_exists(path)
    • attribute_not_exists(path)
    • attribute_type(path, type)
    • contains(path, operand)
    • begins_with(path, substr)
    • size(path)
  • Logical
    • a AND b
    • a OR b
    • NOT a
info

boto3.dynamodb.conditions 을 μ΄μš©ν•΄μ„œ ν‘œν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

UpdateExpression

  • SET path = value [, path = value]
    • SET path = value
    • SET path = operand + operand
    • SET path = operand - operand
    • SET path = list_append(operand, operand)
  • REMOVE path [, path]

ExpressionAttributeNames

ExpressionAttributeValues

ReturnValues

  • NONE: κΈ°λ³Έκ°’
  • ALL_OLD
  • UPDATED_OLD: μ—…λ°μ΄νŠΈν•˜κΈ° μ „ path의 κ°’λ§Œ λ°˜ν™˜
  • ALL_NEW
  • UPDATED_NEW

ReturnConsumedCapacity

  • INDEXES: κΈ°λ³Έ ν…Œμ΄λΈ” + 인덱슀 ν…Œμ΄λΈ”
  • TOTAL: κΈ°λ³Έ ν…Œμ΄λΈ”
  • NONE

Reference