Dynamodb基础操作

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuzhong8809/article/details/88293719

假设有一张表名为 test_table;

案例一:全表扫描

SQL:

select * from test_table;

Dynamodb:

aws dynamodb scan --table-name test_table --endpoint-url http://localhost:8000

案例二:特定主键查询

SQL:

select * from test_table where messageId ='ce6451ad-9e5c-46f1-bf9f-4845335edf78';

Dynamodb:

aws dynamodb query --table-name test_table --key-condition-expression "messageId = :name" --expression-attribute-values '{":name":{"S":"ce6451ad-9e5c-46f1-bf9f-4845335edf78"}}' --endpoint-url http://localhost:8000

扫描二维码关注公众号,回复: 5451907 查看本文章

案例三:查看表结构

SQL:

desc test_table

Dynamodb:

aws dynamodb describe-table --table-name message-push-record --endpoint-url http://localhost:8000

案例四:列出表

SQL:

show tables;

Dynamodb:

aws dynamodb list-tables --endpoint-url http://localhost:8000
 

猜你喜欢

转载自blog.csdn.net/wuzhong8809/article/details/88293719
今日推荐