简体   繁体   中英

DynamoDB GetItemResult GetItem for multiple items

As I understand it, the return value for GetItem is Map<String,AttributeValue> . This is a map of attribute name to attribute value for a single item, a row, in the DB.

What if the hash and range values don't result in an unique result? Does the SDK throw an exception or something? My table is set up so that with hash and range attributes I set I will generally not get unique results.

I understand I can do a query and get multiple items back, but it is more expensive and slower?

The composite key hash + range should result in unique result only.
If you have a table with both hash and range key then dynamo db will override the previous value of the row with the same hash and range value.

So this is not possible -->

My table is set up so that with hash and range attributes I set I will generally not get unique results.

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