简体   繁体   中英

how to read item from dynamoDb in aws?

I got error when try to read item from dynamodb by using getItem()

This is my code snippet:

DynamoDB dynamoDB = new DynamoDB(new AmazonDynamoDBClient(new ProfileCredentialsProvider()));  
Table table = dynamoDB.getTable("ProductList");  
Item item = table.getItem("IDnum", 109);

i got error like attribute mismatch

The code you are sharing comes from https://www.tutorialspoint.com/dynamodb/dynamodb_getting_items.html . It works as expected, ensure that you are passing the correct partition key name for your table.

public Item getItem(String hashKeyName,
                    Object hashKeyValue)

Reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM