如何在本地使用GlobalSecondaryIndexes在DynamoDB上创build表?

我DynamoDB在Windows 7本地安装。我的项目是一个Node.js(0.12.0),我使用aws-sdk。

版本DynamoDB:2012-08-10

这项工作 – >

dynamodb.createTable({ TableName: 'Users', AttributeDefinitions: [{AttributeName: 'userId', AttributeType: 'S'}], KeySchema: [{AttributeName: 'userId', KeyType: 'HASH'}], ProvisionedThroughput: { 'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5 } }, function () { ... }); 

这不起作用 – >

 dynamodb.createTable({ TableName: 'Users', AttributeDefinitions: [{AttributeName: 'userId', AttributeType: 'S'}], KeySchema: [{AttributeName: 'userId', KeyType: 'HASH'}], ProvisionedThroughput: { 'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5 }, GlobalSecondaryIndexes: [ { IndexName: 'longitudeUserIndex', KeySchema: [ { AttributeName: 'userId', KeyType: 'HASH' }, { AttributeName: 'longitude', KeyType: 'RANGE' } ], Projection: { NonKeyAttributes: [ ], ProjectionType: 'KEYS_ONLY' }, ProvisionedThroughput: { 'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5 } } ] }, function () { ... }); 

Doc DynamoDB Javascript: http ://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#createTable-property

       

网上收集的解决方案 "如何在本地使用GlobalSecondaryIndexes在DynamoDB上创build表?"