Unable to get Dynamodb table values in python

Viewed 1012

I have a DynamoDB table called "Users" Where there is only one partition key called "UserID"

enter image description here

I have only two values in the table and would like to get all values from the value in the partition key.

enter image description here

I have tried a few different things to get it.

dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.Table('Users')    
table.get_item(Key={"UserId":"blahblah"})
Output

    {'ResponseMetadata': {'RequestId': 'blah', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Sat, 15 Jul 2017 13:09:12 GMT', 'content-type': 'application/x-amz-json-1.0', 'content-length': '2', 'connection': 'keep-alive', 'x-amzn-requestid': 'blah', 'x-amz-crc32': '2745614147'}, 'RetryAttempts': 0}}

Also tried

client = boto3.client('dynamodb',"us-east-1")
client.get_item(TableName='Users', Key={"UserId":{"S":"blahblah"}})

{'ResponseMetadata': {'RequestId': 'blah', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Sat, 15 Jul 2017 13:13:19 GMT', 'content-type': 'application/x-amz-json-1.0', 'content-length': '2', 'connection': 'keep-alive', 'x-amzn-requestid': 'blah', 'x-amz-crc32': '2745614147'}, 'RetryAttempts': 0}}

As we can see there is some content length in there but I dont understand Y I can get them ??

Any ideas or hints?

0 Answers
Related