为了列出本地dynamoDB中的所有表,我知道命令,即
aws dynamodb list-tables --endpoint-url http://localhost:8000
但我想查看其中一个表中的内容.
让我知道命令是什么?
谢谢,斯里兰卡
not*_*est 25
转到" http:// localhost:8000/shell / "并执行以下脚本.请根据您的要求更改表名.
运行本地DynamoDB时,上面的URL应该已启动并正在运行.
var dynamodb = new AWS.DynamoDB({
region: 'us-east-1',
endpoint: "http://localhost:8000"
});
var tableName = "TESTTABLE";
var params = {
TableName: tableName,
Select: "ALL_ATTRIBUTES"
};
function doScan(response) {
if (response.error) ppJson(response.error); // an error occurred
else {
ppJson(response.data); // successful response
// More data. Keep calling scan.
if ('LastEvaluatedKey' in response.data) {
response.request.params.ExclusiveStartKey = response.data.LastEvaluatedKey;
dynamodb.scan(response.request.params)
.on('complete', doScan)
.send();
}
}
}
console.log("Starting a Scan of the table");
dynamodb.scan(params)
.on('complete', doScan)
.send();
Run Code Online (Sandbox Code Playgroud)
查看本地动态数据的一种方法是使用命令行。您可以例如做一张scan桌子。请注意,scan-command可能很重。
aws dynamodb scan \
--table-name my_table_name
--endpoint-url http://localhost:8000
Run Code Online (Sandbox Code Playgroud)
--endpoint-url如果您使用的是DynamoDB的托管版本,请跳过该参数。
如果您不想执行- scan,则get-item-command可能是合适的。
命令:
我最近遇到的 dynamodb local 的免费可视化选项是dyanamodb-admin. 你可以在这里查看:https : //github.com/aaronshaf/dynamodb-admin
这个开源(dynamodb-manager)工具非常好。
它具有以下特点:
桌子
物品
搜索(表或索引)
用法:
docker pull taydy/dynamodb-manager
docker run -t -p 8080:80 taydy/dynamodb-manager
Run Code Online (Sandbox Code Playgroud)
在浏览器中打开以下网址:
http://localhost:8080/ 或 http://127.0.0.1:8080/
| 归档时间: |
|
| 查看次数: |
15600 次 |
| 最近记录: |