我在 dynamoDB JS shell 中创建了一个表,其中 stu_id 作为 hash_key_attribute。
var params = {
TableName: 'student_test',
KeySchema: [
{ // Required HASH type attribute
AttributeName: 'stu_id',
KeyType: 'HASH',
},
],
AttributeDefinitions: [
{
AttributeName: 'stu_id',
AttributeType: 'N', },
],
ProvisionedThroughput: { // required provisioned throughput for the table
ReadCapacityUnits: 1,
WriteCapacityUnits: 1,
},
};
dynamodb.createTable(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
现在我想添加 stu_name 和 school 列并插入值。尝试在 GlobalSecondaryIndexes 中定义列名,但没有成功。
我在本地使用 DynamoDB。