3

I have a problem about dynamodb updateItem, here is my code

response = dynamoTable.update_item(
    Key={
        'User':  event['User']
    },
    UpdateExpression="set #T[0].#Year.#Month.#Day.#Hour = :i",
    ExpressionAttributeNames = {
        "#T" : 'time',
        "#Year" : event["Year"],
        "#Month" : event["Month"],
        "#Day" : event["Day"],
        "#Hour" : event["Hour"]
    },
    ExpressionAttributeValues={
        ':i': event["Value"]
    }
)

i want to storage my daily data to dynamodb 2020-01-02 03:00 value 4

then in my dynamodb will update table like this

time[{'2020':{'01':{'02':{03: 4}}}}] 

i can update other hour data (2020-01-02 04 value 3)

but cant update another day data(2020-01-03 03 value 3)

error message:

The document path provided in the update expression is invalid for update
ESCoder
  • 15,431
  • 2
  • 19
  • 42
saint
  • 103
  • 11

0 Answers0