Questions tagged [dynamodb-queries]
Use when content is about querying or scanning Amazon DynamoDB managed database.
dynamodb-queries
1,320
questions
0
votes
1
answer
34
views
DynamoDB - Single table with multiple entities - Fetch multiple entity data in one query
In my project we are using single table design for storing data in multiple entities.
Now this data is primarily the configuration related data which we are querying while processing our events and ...
0
votes
2
answers
33
views
DynamoDB BatchGetCommand 400 "key does not match schema"
I'm having an issue using BatchGetCommand to get a list of records from a DynamoDB table.
I am using an AWS Lambda that uses NodeJS 18.x.
I have been able to get ScanCommand, GetCommand and ...
0
votes
1
answer
16
views
error while performing dynamo.query(params); from lambda function
When performing body = await dynamo.query(params); from a lambda function, i am getting response as :
"statusCode": "400",
"body": "User: arn:aws:sts::891377999999:...
-1
votes
1
answer
21
views
How to paginate filtered results with DynamoDB scan?
I have a DynamoDB table with a PK id and attributes status (boolean) and type (string with two values). I need to implement pagination for results filtering on status and type. My current approach ...
-2
votes
1
answer
41
views
DynamoDbIndex.scan() with filter expression doesn't work
In my code I use this class as Java entity for DynamoDB table:
@DynamoDbBean
@Data
public class RecordDynamoDB {
private String id;
private String customerIdHash;
private OffsetDateTime ...
1
vote
2
answers
34
views
Deleting records from a DynamoDB table where the TTL value has been set incorrectly
I've inherited a service where the TTL value for the DynamoDB records is in the following format
2022-11-03T10:35:42.920Z
Does anyone know how I can run a query to delete all the records with a TTL ...
-1
votes
1
answer
25
views
Ordering in dynamodb with limit
Currently I have a dynamodb (of which I cant anymore change the way the data is structured) which has a partition and sortKey but both are pretty much used as the composite primary key of the data (...
0
votes
0
answers
47
views
Unable to delete an item in aws dynamodb
Unable to delete an item in aws dynamodb using aws-cli:
Table data in json format:
{
"primaryKeyAttributeName": {
"S": "2024-06-17"
},
"sortKeyCreatedOn&...
0
votes
2
answers
48
views
DynamoDB V2 Enhanced SDK to get only one record matching a partition key
I have a DynamoDB table that has a partition key and a sort key.
In my Java code I need to get one (and only one) record with a partition key if that record exists.
Currently I am using DynamoDB V2 ...
2
votes
1
answer
43
views
How to efficiently paginate large nested lists in DynamoDB?
I'm working on a chat application where each chat session is stored as an item in a DynamoDB table. The structure of a chat item looks like this:
{
"chatId": {
"S": "...
0
votes
1
answer
64
views
DynamoDB query works on CLI but not in Lambda: "Value null at 'key' failed to satisfy constraint"
On the CLI this works:
aws dynamodb query \
--table-name BatchTable \
--index-name completed_index \
--key-condition-expression "completed = :completed" \
--expression-...
-1
votes
1
answer
42
views
Handling rollbacks while inserting records to DynamoDB
I'm currently inserting data to dynamoDB database using transactWrite. Transactions are only allowed for a batch of small chunk (let's say 100) but I want to add 500 items in the database in a All-or-...
1
vote
1
answer
26
views
How to Retrieve and Paginate Items in DynamoDB Table Ordered by Date?
I want to retrieve all items from the "albums" table in DynamoDB using pagination, ordered by date. Currently, I can paginate items using the Scan command, but the result set is not ordered.
...
0
votes
1
answer
17
views
Access Pattern with Between for Date, Origin and OriginId
I got the following table, I made a quick mock with a reduced set of attributes
I now have to solve these two access-patterns without a GSI, since I need the current real data from the table. GSI ...
0
votes
0
answers
23
views
Why is LoadAsync returning incorrect data from DynamoDB?
I'm trying to create a Dictionary app API using AWS that can Load a dictionary entry from DynamoDB.
The problem is that when I try to GET a dictionary entry from the DB using LoadAsync, all of the ...