Use when content is about querying or scanning Amazon DynamoDB managed database.
Questions tagged [dynamodb-queries]
1232 questions
16
votes
1 answer
The correct way to query DynamoDb table with .net SDK
I'm trying to understand how to query a table in dynamo using the DataModel. But, I found two ways that seems to work and I can't find an explanation or documentation of what's happening or if there is any difference between them.
The ways of doing…

matheuswanted
- 163
- 1
- 5
15
votes
4 answers
dynamodb PartiQL SELECT query returns ValidationException: Unexpected from source
I am using Amplify to setup a dynamodb with a corresponding lambda using the amplify blueprint for dynamodb.
Accessing the dynamodb the "classic" way with KeyConditionExpression etc works just fine but today I wanted to try and use PartiQL instead…

user1816142
- 1,199
- 2
- 9
- 16
13
votes
2 answers
How to design key schema to have only one DynamoDB table per application?
According to DynamoDB doc: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-nosql-design.html
"You should maintain as few tables as possible in a DynamoDB application. Most well designed applications require only one…

Arsenii Fomin
- 3,120
- 3
- 22
- 42
11
votes
3 answers
Forward and Backward Pagination in DynamoDB
I'm using DynamoDB and NodeJS to enlist some objects on the UI. The list is long, and since DynamoDB can scan/query at most 1MB of data at a time, I've decided to use pagination so at the front end I have Previous and Next buttons to paginate back…

infinityskyline
- 369
- 2
- 4
- 17
11
votes
2 answers
How can I implement two sort keys in Dynamo DB?
I’m building a database using DynamoDB on AWS.
I am using variable X as a partition key, and variable Y as a sort key.
I also have a variable Z which i need as a second sort key.
Is there a way to do this?

Bob
- 357
- 1
- 3
- 14
11
votes
2 answers
How to delete multiple rows in DynamoDB?
I am attempting to delete data from a DynamoDB table.
If I delete data using a partition key, it works.
But when I delete multiple rows using any other fields, it fails.
var params = {
TableName: "test",
Key: {
dmac: dmac,
},
…

Dhaval Mojidra
- 194
- 1
- 2
- 11
10
votes
1 answer
DynamoDB: Two document paths overlap with each other; must remove or rewrite one of these paths
I have this update expression :
{
"UpdateExpression": "SET #location = :location, #edited = :edited, #coordinates = :coordinates, #city = :city, #country = :country, #zipCode = :zipCode, #street = :street, coordinates = :coordinates",
…

super7egazi
- 706
- 1
- 8
- 22
10
votes
1 answer
DynamoDBSaveExpression with conditional check on GSI
I want to make an update but the conditional check I want to add is not based on the Hash/Range of the primary table but of a GSI.
Effectively, I want to fail the save if a given attribute (i.e. GSI's hash) already exists.
As an example, in an…

instanceOfObject
- 2,936
- 5
- 49
- 85
9
votes
4 answers
AWS Local DynamoDB The security token included in the request is invalid
I am new to AWS and I am trying to perform CRUD operation on Local DynamoDB from a Java program. The Java program is an AWS sample.
I have AWS CLI installed and have set the following configuration - As per AWS documentation, I don't need a real…

user2693135
- 1,206
- 5
- 21
- 44
9
votes
1 answer
DynamoDB: When does 1MB limit for queries apply
In the docs for DynamoDB it says:
In a Query operation, DynamoDB retrieves the items in sorted order, and then processes the items using KeyConditionExpression and any FilterExpression that might be present.
And:
A single Query operation can…

J. Hesters
- 13,117
- 31
- 133
- 249
9
votes
1 answer
Query a table with primary key and two conditions on sort key
I'm trying to query a dynamodb table using the partition key and a sort key. The sort key is a unix date, so I want to request x partition key between these 2 dates on the sort. I am currently able to achieve this with a table scan, but I have to…

rlou
- 498
- 4
- 16
8
votes
1 answer
Dynamodb Model data for Start Date End Date range query
My Question could be similar to the below question
How to query for an entry that falls between start and end date - DynamoDB
but I think is different in terms of my requirement and what I am looking for.
For a particular Partition key value, I want…

Bhargava
- 421
- 5
- 21
8
votes
2 answers
Using nested fields in the projection of a DynamoDB GSI
I've got a Dynamo table storing documents that look like this:
{
"guid": ""
"created_at": 1550778260030,
"display_name": "person",
"updated_at": 1550778260030,
"info": {
"locked": false,
"confirmed": true,
…

JDiPierro
- 802
- 1
- 9
- 28
8
votes
1 answer
How to Query a Array of objects in DynamoDB using FilterExpression in scan operation
How to Query array of objects(workingDays) key containing only "Tue" in dynamoDb with Scan Operation,I have queried using filter Expression but i am getting no results.
var queryData = {
TableName: tableName,
FilterExpression:…

RAHUL SRV
- 262
- 3
- 24
8
votes
3 answers
Calculate size of items in my Amazon DynamoDB table
I'd like to figure out the size of items in my Amazon DynamoDB table or the full size so i can accurately forecast costs in a project I'm working on.
I understand that for every 4kb of data read it will use 1RCU. So now id like to find out the size…

zuba
- 365
- 1
- 4
- 14