Search code examples
pythonamazon-dynamodbboto3dynamodb-queries

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.


Solution

  • 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'])