JavaScript:读取项目 AWS dynamodb

标签 javascript amazon-web-services amazon-dynamodb

我正在尝试读取 dynamodb 中 table_user 上的数据: My database [Please look]

 AWS.config.update({
  region: "us-west-2",
  endpoint: 'https://dynamodb.us-west-2.amazonaws.com/',
  // accessKeyId default can be used while using the downloadable version of DynamoDB. 
  // For security reasons, do not store AWS Credentials in your files. Use Amazon Cognito instead.
  accessKeyId: "fake",
  // secretAccessKey default can be used while using the downloadable version of DynamoDB. 
  // For security reasons, do not store AWS Credentials in your files. Use Amazon Cognito instead.
  secretAccessKey: "fake"
});

var docClient = new AWS.DynamoDB.DocumentClient();

function queryData() {
    document.getElementById('textarea').innerHTML += "Querying for movies from 1985.";

   var table = "table_users";


var title = "love";

var params = {
    TableName: table,
    Key:{
        "rawa_rese": title
    }
};

docClient.get(params, function(err, data) {
    if (err) {
        console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
    } else {
        console.log("GetItem succeeded:", JSON.stringify(data, null, 2));
    }
});
}

但是得到:

Unable to read item. Error JSON: { "message": "Requested resource not found", "code": "ResourceNotFoundException", "time": "2018-12-27T17:17:56.207Z", "requestId": "G06LO9DH60AB9OK419826ISNJNVV4KQNSO5AEMVJF66Q9ASUAAJG", "statusCode": 400, "retryable": false, "retryDelay": 0, "line": 36, "column": 29583, "sourceURL": "https://sdk.amazonaws.com/js/aws-sdk-2.7.16.min.js" }

我如何获得这张唱片love

最佳答案

这只是一个错字。您使用了 table_users,其中表名称为 table_user

关于JavaScript:读取项目 AWS dynamodb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53948667/

相关文章:

javascript - 网络开发新手,遇到错误(jsfiddle)

php - browscap ini 指令未设置

javascript - 无法从 Modal 元素获取 $file,Angular JS

amazon-web-services - 没有存储桶策略的 s3 预签名 url 不起作用

node.js - AWS Dynamodb : Is it possible to make a query only using sort key

amazon-web-services - dynamodb 中的哈希键和范围键是什么以及如何使用它们

javascript - 了解正则表达式?

linux - 通过 VPN : connection timed out SSH 到在 VPC 中的私有(private)子网中运行的 EC2 实例

node.js - AWS.DynamoDB.DocumentClient 未提供放置数据

javascript - 如何避免 Javascript 奇怪的 Float 行为?