dynamodb-queries

pynamodb last_evaluated_key always return null

pynamodb last_evaluated_key always return null Question: I’m using Pynamodb for interacting with dynamodb. However, last_evaluated_key always returns null even if there are multiple items. When I run this query results = RecruiterProfileModel.profile_index.query( hash_key=UserEnum.RECRUITER, scan_index_forward=False, limit=1, ) If I try getting this value results.last_evaluated_key it always returns null. However, if I dump the results object, it …

Total answers: 2

Dynamodb query using FilterExpression involving nested attributes with boto3

Dynamodb query using FilterExpression involving nested attributes with boto3 Question: I have below data in my dynamodb table with name as partition-key. { "name":"some-name", "age": 30, "addresses":[ "addr-1", "addr-2" ], "status":"active" } I have a GSI defined with partition-key on status field. Now, I have to run a query which returns all records whose status …

Total answers: 1

Hardcoded Credentials for Dynamodb AWS Queries

Hardcoded Credentials for Dynamodb AWS Queries Question: I have a script which checks if a specific value is inside a cell in a dynamodb table in AWS. I used to add hardcoded credentials containing the secret key in my script such as this: dynamodb_session = Session(aws_access_key_id=’access_key_id’, aws_secret_access_key=’secret_access_key’, region_name=’region’) dynamodb = dynamodb_session.resource(‘dynamodb’) table=dynamodb.Table(‘table_name’) Are there any …

Total answers: 1

DynamoDb update using boto3

DynamoDb update using boto3 Question: I am writing a lambda function to update dynamodb item. But the problem is that when I give { "employee_id": "1", "last_name": "jane", "first_name": "anderson" } It works fine but if you remove the last_name or the first_name the program crashes.I want to make it dynamic like if I provice …

Total answers: 2