小编Sud*_*shu的帖子

如何使所有字段都出现在aws-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: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services node.js amazon-dynamodb

5
推荐指数
1
解决办法
2242
查看次数

设置AWS DynamoDB表的验证规则

实际上,我想对AWS DynamoDB表项目实施验证,如果规则违反项目字段,这将阻止记录插入/更新。

可能吗?

还是我们可以为dynamoDB表创建触发器lambda,该触发器在插入/更新之前触发。这样我们就可以检查验证规则并进行处理。

amazon-dynamodb aws-lambda amazon-dynamodb-streams

4
推荐指数
1
解决办法
1292
查看次数