Sud*_*shu 5 amazon-web-services node.js amazon-dynamodb
我正在使用Node.js
var AWS = require('aws-sdk');
AWS.config.update({
region: "region",
endpoint: "https://dynamodb.region.amazonaws.com"
});
var dynamodb = new AWS.DynamoDB();
var params = {
TableName: "acc_new"
};
dynamodb.describeTable(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(JSON.stringify(data));
});
Run Code Online (Sandbox Code Playgroud)
输出:
{ AttributeDefinitions: [ { AttributeName: 'Id', AttributeType: 'S' } ],
TableName: 'acc_new',
KeySchema: [ { AttributeName: 'Id', KeyType: 'HASH' } ],
ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
Run Code Online (Sandbox Code Playgroud)
输出仅包含与表关联的键架构(仅散列键和范围键),而不是所有属性。我想获取与表中数据关联的所有属性。
喜欢:
{ AttributeName: 'AccountName', AttributeType: 'S' }
{ AttributeName: 'CreatedBy', AttributeType: 'S' }
...
...
Run Code Online (Sandbox Code Playgroud)
有什么方法可以获取有关dynamoDb表及其所有数据字段的描述。
DynamoDB 是一个 NoSQL 数据库。创建表时,并不期望表中定义所有属性。此外,每个项目可以具有任意数量的非关键属性。表中所有项目中只有关键属性是通用或强制的。
由于上述原因,描述表无法提供表中存在的所有属性。
| 归档时间: |
|
| 查看次数: |
2242 次 |
| 最近记录: |