Database Reference
In-Depth Information
CreateTable
To perform the CreateTable operation, the request JSON will look as follows:
{
"AttributeDefinitions": [
{ "AttributeName": "BookTitle", "AttributeType": "S" },
{ "AttributeName": "Author", "AttributeType": "S"},
{ "AttributeName": "PubDate","AttributeType": "S"},
{ "AttributeName": "Language", "AttributeType": "S"},
{ "AttributeName": "Edition", "AttributeType": "N" } ],
"TableName": "Tbl_Book",
"KeySchema": [
{"AttributeName": "BookTitle", "KeyType": "HASH"},
{ "AttributeName": "Author", "KeyType": "RANGE"} ],
"LocalSecondaryIndexes": [
{ "IndexName": "Idx_PubDate", "KeySchema": [
{"AttributeName": "BookTitle", "KeyType": "HASH" },
{ "AttributeName": "PubDate","KeyType": "RANGE" } ],
"Projection": { "ProjectionType": "KEYS_ONLY" } } ],
"GlobalSecondaryIndexes": [
{ "IndexName": "Idx_Pub_Edtn", "KeySchema": [
{"AttributeName": "Language", "KeyType": "HASH" },
{ "AttributeName": "Edition","KeyType": "RANGE" } ],
"Projection": { "ProjectionType": "KEYS_ONLY" } } ],
"ProvisionedThroughput":
{"ReadCapacityUnits": 2, "WriteCapacityUnits": 2}
}
The preceding code will create the Tbl_Book table with the same schema that we have
discussed in earlier chapters. The response to this request is the same as that of the
DescribeTable operation.
Search WWH ::




Custom Search