Back
Close

Computing with Data

elgeish
576.8K views

Amazon DynamoDB - Part II

To get that item we just created, we simply can query for it:

from pprint import pprint

import boto3

dynamodb = boto3.resource('dynamodb')
response = dynamodb.Table('reminder').get_item(
  Key={
  'timestamp': 1511643670,
  'userID': '[email protected]',
  }
)
pprint(response['Item'])
## {u'text': u'write a DynamoDB example',
##   u'timestamp': Decimal('1511643670'),
##   u'ttl': Decimal('1511730070'),
##   u'userID': u'[email protected]'}
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io