首页 > 解决方案 > Dynamodb updateItem 正在复制记录

问题描述

所以,这是一个非常简单的问题,我不明白为什么要使用下面的 UpdateItemRequest 复制记录:(注意,已经有一辆 Car_id == 826550096186605568 的汽车,但它总是在创建一个新的汽车。我没有设置属性更新在这里,但设置在我身边。任何人都可以帮助我吗?

{
  "requestOverrideConfig" : null,
  "tableName" : "Cars",
  "key" : {
    "car_id" : {
      "s" : null,
      "n" : "826550096186605568",
      "b" : null,
      "ss" : [ ],
      "ns" : [ ],
      "bs" : [ ],
      "m" : { },
      "l" : [ ],
      "bool" : null,
      "nul" : null
    }
  },
  "attributeUpdates" : { },
  "expected" : { },
  "conditionalOperator" : null,
  "returnValues" : null,
  "returnConsumedCapacity" : null,
  "returnItemCollectionMetrics" : null,
  "updateExpression" : null,
  "conditionExpression" : "#07220 = :07220",
  "expressionAttributeNames" : {
    "#07220" : "car_id"
  },
  "expressionAttributeValues" : {
    ":07220" : {
      "s" : null,
      "n" : "826550096186605568",
      "b" : null,
      "ss" : [ ],
      "ns" : [ ],
      "bs" : [ ],
      "m" : { },
      "l" : [ ],
      "bool" : null,
      "nul" : null
    }
  }
}

描述表如下:

{
    "Table": {
        "AttributeDefinitions": [
            {
                "AttributeName": "car_id",
                "AttributeType": "N"
            }
        ],
        "TableName": "Cars",
        "KeySchema": [
            {
                "AttributeName": "car_id",
                "KeyType": "HASH"
            }
        ],
        "TableStatus": "ACTIVE",
        "CreationDateTime": 1616108934.89,
        "ProvisionedThroughput": {
            "LastIncreaseDateTime": 0.0,
            "LastDecreaseDateTime": 0.0,
            "NumberOfDecreasesToday": 0,
            "ReadCapacityUnits": 1,
            "WriteCapacityUnits": 1
        },
        "TableSizeBytes": 130585,
        "ItemCount": 196,
        "TableArn": "arn:aws:dynamodb:ddblocal:000000000000:table/Cars"
    }
}

标签: amazon-dynamodb

解决方案


推荐阅读