2
ダイナモローカルにデータを挿入したい。しかし、私は1つのキー属性と複数の非キー属性しか持っていません。Dynamodb-非キーアトリビュートを追加する
{
'id':'99876983ydbhdu3739',
'category':'Spa',
'latitude':'33.498',
'longitude':'32.332',
'name':'Studio'
}
このような値は複数あります。これは1つのレコードです。挿入するレコードの例です。私がしようとしていますものです、以下:
table = dynamodb.create_table(
TableName='Trial',
KeySchema=[
{
'AttributeName': 'facebook_id',
'KeyType': 'HASH' #Sort key
},
{
'AttributeName': 'latitude',
'KeyType': 'RANGE' #Sort key
},
],
AttributeDefinitions=[
{
'AttributeName':'id',
'AttributeType':'S'
},
{
'AttributeName': 'category',
'AttributeType': 'S'
},
{
'AttributeName': 'latitude',
'AttributeType': 'S'
},
{
'AttributeName': 'longitude',
'AttributeType': 'S'
},
{
'AttributeName': 'name',
'AttributeType':'S'
}
],
ProvisionedThroughput={
'ReadCapacityUnits': 10,
'WriteCapacityUnits': 10
}
)
私は次のエラーを取得する:
An error occurred (ValidationException) when calling the CreateTable operation: The number of attributes in key schema must match the number of attributesdefined in attribute definitions.
任意のヘルプ?