1,333 questions
0
votes
1
answer
46
views
Effective pagination for descending order queries in DynamoDB
I have an use-case of building a news feed for which I store the articles along with the timestamps in a DynamoDB table. I want to build infinite scrolling capability, and retrieve the article with ...
0
votes
1
answer
98
views
How DynamoDb console maintains pagination along with filtering
Suppose I have 110 records and I filter upon status for the first page two calls are made the first calls scans 25 items and after filter it receives 20 matching items , it uses the id of the 25th ...
0
votes
1
answer
74
views
DynamoDB async query calling subscribed consumer after timeout
TLDR: DynamoDB async query on GSI is returning duplicates when forcibly timing out the query request.
I'm running performance tests on a solution built with CompletionStage and the non-blocking ...
0
votes
1
answer
76
views
How to query multiple DynamoDB objects at the time
I have a table Tours with a Partition Key (PK) id, which is unique and a Global Secondary Index (GSI) geohash, which has repeated values.
I need to get all the geohashes in the array geohashNeighbors, ...
1
vote
0
answers
71
views
DynamoDB returning empty between two dates
I have this table that has this line on it as you can see below:
id,"data_dia","nome_completo","nome_produto","nome_tuna","numero_socio","...
-4
votes
1
answer
55
views
Filter by sort key is substring of the given input [closed]
I have an interesting use-case where I want to check if in my dynamo table there exists a key value pair whose sort key is a substring of the given input string. I dont want to fetch all the data in ...
0
votes
0
answers
39
views
How should one prevent a DDB item being deleted unless there are no items left which reference it?
Let's say I have 2 types of item in my DDB table: Trains and Passengers. They look like this:
{
"type": "train",
"id": "OrientExpress" // partition key
}
{
...
-1
votes
1
answer
64
views
Is ConsumedWriteCapacityUnits metric for DynamoDB emitted as a sum every minute?
This has been really confusing for me and I couldn't find an answer even on AWS support.
Docs suggest that ConsumedWriteCapacityUnits is emitted at a 1 minute granularity.
I want to understand if that ...
0
votes
1
answer
38
views
Counting Items and Handling Duplicates in DynamoDB Without Full Data Traversal in Node.js
The problem involves efficiently counting the total number of items in an Amazon DynamoDB table while handling duplicates, without traversing each item or returning the entire dataset. This requires a ...
0
votes
2
answers
83
views
How can the DynamoDB GetLatency higher than Query?
Theoretically the getItem latency in dynamodb should be lower than query in dynamodb. but I am getting higher latency for get. Partition is not very large just 5-6 items of small size.
Query Latency : ...
1
vote
0
answers
120
views
AWS Amplify Gen 2: ctx.stash is empty in AppSync JS resolver when using custom handler
I am trying to write a custom batch mutation using Amplify Gen 2, but running it results in an error:
DynamoDB:DynamoDbException", message: "User: arn:aws:sts::{AWS_ACCOUNT_ID}:assumed-role/...
0
votes
1
answer
149
views
how to find the max sized item from dynamodb table?
From the dynamodb tables, I'm trying to get max sized item (top 3 with their ID) from the table. Is there a way that we can get the max sized item using scan or query. The table doesn't have any item ...
-1
votes
1
answer
199
views
DynamoDB Query Not Returning Any Items
This may sound ridiculous to ask. But on a serious note, I am putting in an item in DynamoDB successfully using PutItemCommand. I confirm it by scanning for items in AWS console.
But on querying it, ...
-2
votes
1
answer
99
views
DynamoDB query main table with only partition key (no sort key)
I wonder how to execute this simple operation using dynamodb java-2 sdk.
I want to query my main table called Products using partition key only. Just like it's shown in the screenshot below.
The ...
0
votes
1
answer
42
views
How to Filter for Coordinate Range in DynamoDB
I have multiple items in DynamoDB structured like this in JSON:
{
"MemoryID": "f...ed2d521d84eb",
"CreationDate": "12-22-2024",
"GeoJSON": {
&...
0
votes
1
answer
45
views
DyanmoDB ValidationException batchWrite
I am attempting to batchWrite items to my users table, but I am receiving a ValidationException. I can't identify why The provided key element does not match the schema. I created a new table, and the ...
0
votes
1
answer
46
views
Dynamodb NON-distributed service: worthwhile to use low cardinality ID as partition key and high cardinality ID as sort key?
I understand the concept of hot keys in Dynamodb: if there is a video game database and country_code is used as partition key while player_id is used as sort key, then when everyone from the same ...
0
votes
1
answer
111
views
Do I save on cost/efficiency by having multiple GSIs use the same PK in DynamoDB?
I have a DynamoDB table with multiple posts that I want sortable by:
likes
views
comments
The Table looks like this:
PK
SK
type
PK1
SK1
PK2
SK2
PK3
SK3
POST#1234#
POST#INFO#
post
SORT#POST#VIEWS#
...
0
votes
2
answers
71
views
Fetching min records for PK without using scan
I am new developer in Dynamo and I am trying to build a query in dynamo to get each registry with the min value of the number of retries for the PK. For example, in the following data set, I want to ...
0
votes
1
answer
71
views
Error while sending query command to DynamoDB: TypeError: Cannot read properties of undefined (reading '0')
I have a DynamoDB table called AllowListedItems. It has the fields Id, name and ignoreNoTraffic. It has a GSI called name-index on the field "name". I'm trying to query the ignoreNoTraffic ...
0
votes
1
answer
187
views
DynamoDB Hot Paritions Key Prefix and Overloading GSIs
I'm trying to implement a single table design in DynamoDB and I've seen recommendations to use prefixes for partition keys to identify entities. For example, a car's record might have a partition key ...
1
vote
1
answer
78
views
DynamoDB Index Design for Finding Items Where an Attribute Contains a Specific Value
Problem
I am currently in the process of designing the database for a software application which will be used by multiple organizations to each manage multiple projects. I am planning on using ...
0
votes
2
answers
350
views
software.amazon.awssdk.services.dynamodb.model.DynamoDbException: The security token included in the request is invalid
I want to use the AWS SKD v2 of DynamoDB which can accepts the table name dynamically and return all the records and I am creating the Rest API for the same. I have to use the access key and secret ...
-1
votes
1
answer
277
views
What will happen if I insert a record into DynamoDB with the same primary key as an existing record that has an expired TTL?
I currently have a record with the primary key 389 in DynamoDB, but its TTL has expired and it hasn't been deleted yet.
If I attempt to insert a record with the same primary key but with an updated ...
-1
votes
1
answer
38
views
DynamoDB Query empty response
I what to get items by query command with local index, but response is empty.
My code:
const client = new DynamoDBClient({});
const input = {
TableName: "...",
IndexName: "...
0
votes
1
answer
58
views
Dynamo DB fetch data from paginated on one table and filter on another table
I have a use case where I have an Entity and it's resources. Entity and resources are stored in separate Dynamo DB table. User make API call to my entity and along that resources are also returned. ...
0
votes
1
answer
152
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
179
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 ...
-1
votes
1
answer
34
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
110
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
60
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
137
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
30
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
1
answer
144
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
396
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
75
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
460
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
255
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
244
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
54
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
50
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 ...
0
votes
1
answer
85
views
DynamoDB Query by Field in a List of Maps
With Dynamodb is it possible to create an expression that will query an attribute that is a list of Objects. For example the POLICY_HOLDERS attribute on the table has the following JSON Structure
[
...
0
votes
1
answer
39
views
What's the best way to query dynamodb when you're constantly comparing against 2 properties of your items?
Suppose I'm building a board game, I divide my board in cells, the board has 100 columns by 100 rows.
In dynamodb, I'm storing the player's position in 2 attributes, col and row.
I need to query what ...
0
votes
1
answer
460
views
DynamoDB ScanCommand with filters
I am very new to DynamoDB and need help with adding following query to my code. Here is what I have but its giving me an exception error.
ValidationException: One or more parameter values were invalid:...
-1
votes
2
answers
92
views
How to work with DynamoDb Sets with DynamoDBDocumentClient from SDK v3?
I'm not able to find an official reference to working with sets with DynamoDBDocumentClient.
How to do all sets actions with TypeScript and AWS SDK v3?
How to create item with set property?
How to ...
0
votes
1
answer
945
views
Best way to do begins_with query on partition key and sort key on dynamodb
I'm currently diving into DynamoDB and I'm struggling with a conceptual problem. The problem, simplified in SQL terms, is as follows: I have a table with two columns. The first column contains ...
0
votes
1
answer
308
views
【AWS DynamoDB】query nested items if sub key exist
Here is the item format on dynamodb table
{
"id":"partition_key_id",
"Products": {
"ProductGroupA": [
{
"Description": "2"...
3
votes
1
answer
50
views
Use DynamoDB GSI with Primary Partition Key
There is an AWS DynamoDB table with partition key and sort key.
Same table has global index which consist with partition key and sort key. Anyway to use combination of GSI and primary partition key ...
-1
votes
2
answers
78
views
Query DynamoDB with array of numbers that is not the pk or sk in NodeJs?
This is my API request body (Array of numbers):
{
"userIds": [10,11,12, 20]
}
Where the usersIds in DB is a number type and it's not the primary or secondary keys.
I need to query ...
1
vote
1
answer
465
views
dynamodb ConditionExpression is not working as expected
I would like to insert record in dynamodb only if the attribute value doesnt exist already.
try:
NewsTable.put_item(
Item={
"PK": "...