Aniiya0978
Aniiya0978

Reputation: 284

Accessing values from dynamodb based on a column value - python

I have a dynamo db having table with column names url, data, date and entity

    url                       data                    date                    entity
 https://www.google.com     search engine             21-09-2021                Website

I am trying to access the values in data column by using values in url column as search tag. How it can be done.

Upvotes: 1

Views: 1159

Answers (1)

Mohan
Mohan

Reputation: 107

Could you please let me know are you using this way?

    import boto3
    from boto3.dynamodb.conditions import Key
    response = table.query(
      KeyConditionExpression=Key('url').eq('https://www.google.com')
    )
    print(response['data'])

Upvotes: 2

Related Questions