Use when content is about querying or scanning Amazon DynamoDB managed database.
Questions tagged [dynamodb-queries]
1232 questions
3
votes
2 answers
How to sort DynamoDB table by a single column?
I'd like to list records from my DDB table ordered by creation date.
My table has an attribute DateCreated.
All examples I can find describe ordering within some partition.
But I want global ordering.
Am I supposed to create an artificial attribute…

Roman
- 64,384
- 92
- 238
- 332
3
votes
0 answers
An error occurred (ValidationException) when calling the UpdateItem operation
I was able to put, delete, and update and attribute with no problem of and item from my dynamoDB, but the problem that I am facing I when I want to update a Map inside of a List because it's seems that is concatenating a lot of maps and entering…

Víctor López Rapado
- 49
- 6
3
votes
1 answer
DynamoDB BatchGet always gives "The provided key element does not match the schema"
So I was stuck for a while now with dynamo db's batchGet operation.
Here is my table definition (in serverless)
Resources:
MyTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: MyTable
…

Aldee
- 4,439
- 10
- 48
- 71
3
votes
1 answer
AppSync pagination issue where no items are returned but a nextToken is
Below I've described the issue and given context. Has anyone here had this problem before? How did you solve it? Or am I just doing something wrong?
Describe the bug
When using cursor based pagination on an AppSync model list, it will return an…

James111
- 15,378
- 15
- 78
- 121
3
votes
1 answer
AWS DynamoDB Query with NodeJs
I have a AWS DynamoDB table with columns email(partition key) and password.
I want to run a query with fetch matching records with combination of giving email and password.
I am using JavaScript(NodeJs) AWS SDK for integration.
But I am facing…

Rahul Gaikwad
- 563
- 4
- 9
- 26
3
votes
2 answers
DynamoDB: Querying all similar items of a certain type
Keeping in mind the best practices of having a single table and to evenly distribute items across partitions using as unique partition keys as possible in DynamoDB, I am stuck at one problem.
Say my table stores items such as users, items and…

Syed Waqas
- 2,576
- 4
- 29
- 36
3
votes
1 answer
Can DynamoDB reads on GSI with badly chosen partition key affect the read/write for the table
I have a DynamoDB table with a good partition key (PK=uuid) but there is a GSI (PK=type, SK=created) where type has only 6 unique values and created is epoch time.
My question is if I start to do a lot of reads with this GSI, will that affect the…

Sumitk
- 1,485
- 6
- 19
- 31
3
votes
3 answers
Can we query and delete item in Amazon DynamoDB at the same time?
We want to run a query, in which all the items that are returned, are deleted. More clearly, what we want to do exactly is run a query, in which if an item matches the condition, it should be included in the response, and be deleted from Amazon…

kartik
- 550
- 1
- 6
- 19
3
votes
0 answers
dynamodb Document path provided in the update expression is invalid for update Map updateItem
I have a problem about dynamodb updateItem, here is my code
response = dynamoTable.update_item(
Key={
'User': event['User']
},
UpdateExpression="set #T[0].#Year.#Month.#Day.#Hour = :i",
ExpressionAttributeNames = {
…

saint
- 103
- 11
3
votes
2 answers
How to remove multiple attributes from DynamoDB on update
I want to delete two attributes from an item in a DynamoDB table. In the docs and everywhere on the internet it shows removing only one attribute. Is it possible to remove multiple attributes at once from an item in DynamoDB table. If so, how? Below…

shamila
- 1,280
- 6
- 20
- 45
3
votes
1 answer
Scanning DynamoDb while updating some items
When I run scan operation on DynamoDb, I can use LastEvaluatedKey that is returned as part of the response to get the scan the next items available. And I can repeat this process until it doesn't return LastEvaluatedKey anymore and that indicates…

muhihsan
- 2,250
- 6
- 27
- 42
3
votes
1 answer
AWS DynamoDB Backwards Scanning Ignores LastEvaluatedKey
I am using AWS for hosting an API with API Gateway and DynamoDB direct integration.
I am trying now to add the pagination feature for my app, and I am having a hard time to implement it 100%.
The problem that I'm facing is when I scan backwards,…

Juan Rivillas
- 897
- 2
- 9
- 23
3
votes
1 answer
How can one get count, with a where condition in DynamoDB
Let us say, We have a situation where instead of getting the total count in a table, get the count of records with a particular status.
We know DynamoDb is schemaless and still has to count each record one by one to get the total count.
And yet, How…

Mukundhan
- 3,284
- 23
- 36
3
votes
1 answer
In DynamoDB, which is faster? Querying by Id or by a secondary index attribute?
I have a DynamoDB table where I need to query on two different attributes, sometimes by one, sometimes by the other one, but never by both at the same time.
Let's say I have an attribute A and attribute B, other attributes are irrelevant here.
I'm…

danilobraga
- 165
- 1
- 9
3
votes
0 answers
how to mark an attribute as both DynamoDBRangeKey and DynamoDBIndexHashKey?
I have a range key field that is also an GSI. Does anybody know how to annotate this attribute with DynamoDBMapper?
FYI, I tried putting both @DynamoDBRangeKey and @DynamoDBIndexHashKey annotations on like below, and it gave an "no RANGE key value…

saksham jain
- 33
- 6