Questions tagged [dynamodb-queries]

Use when content is about querying or scanning Amazon DynamoDB managed database.

1232 questions
6
votes
3 answers

How to get total number of pages in DynamoDB if we set a limit?

I have a list of documents that are stored in DynamoDB. There are more than 10,000 documents being stored in the db. I have set the limit to 100 when requesting. DynamoDB is doing a good job by returning me the first 100 documents and the…
Ibrahim
  • 336
  • 2
  • 13
6
votes
0 answers

DynamoDB: how to design a schema for an item with tags (descriptors)?

I want to design a DynamoDB table for e.g. a blog site where each post could include zero to three "tags" (similar to the keywords/tags that a Stack Overflow can include prior to posting). The access pattern would be to get all posts with tag1,…
Kwhitejr
  • 2,206
  • 5
  • 29
  • 49
6
votes
1 answer

In class DynamoDBMapper.FailedBatch what does Map> unprocessed items contain?

In class DynamoDBMapper.FailedBatch what does Map> unprocessed items contain? What is the best way to retry this failed batch?
YOUNGPITAJI
  • 65
  • 1
  • 4
6
votes
1 answer

Batch query to a GSI in DynamoDB?

Is it possible to create a single query on multiple hash key values simultaneously using DynamoDBMapper on a GSI? For example, if I'm trying to get all relevant records in a table Table using a GSI I'd iterate through all my hash key values and make…
6
votes
1 answer

How return JSON object from DynamoDB with appsync?

How I can get JSON object in response from DynamoDB ? I store data in DB as array of object in format JSON. I have next mapping template request { "version": "2017-02-28", "operation": "PutItem", "key": { "userId": { "S": …
5
votes
1 answer

DynamoDB query performance with - a unique partition key vs a unique partition+sort key

Lets say I have a Dynamo DB table named 'student_course'. I want to store the course that each student is taking in a University. One student can take multiple courses at a time and one course can have many student at a time. So basically it is a…
raviiii1
  • 936
  • 8
  • 24
5
votes
2 answers

DynamoDB enum conversion version 2

I am migration to AWS java sdk to version 2 to improve cold starts for infrequently used lambdas. In version 1.x i used @DynamoDBTypeConvertedEnum to annotate enums and @DynamoDBDocument to store nested objects. how could i achieve the same, i don't…
tsingh
  • 361
  • 1
  • 5
  • 17
5
votes
2 answers

What does LastEvaluatedKey contain when using Secondary Indexes in AWS DynamoDB?

Let's say I have a DynamoDB table T with H, R, G, and S as attributes; H being the partition/hash key and R being the range/sort key. Let's say I also have a global secondary index (GSI) that is defined with partition key as G and sort key as…
Nitin
  • 87
  • 12
5
votes
2 answers

DynamoDb 'MissingRequiredParameter' and 'Unexpected Key "M" '

I'm stumped as to why I am getting the error. Seems like it is just ignoring the items that I pass in. I have tried the various combinations below and a lot of others. Tried get, delete , put methods etc, no luck. Tried Changing 'Item' and 'Key'…
5
votes
3 answers

Query works at the console but not in code

My DynamoDB table alexas has this item with key "abc" as seen in the DynamoDB console below: However, the following query returns no result: const params = { TableName: "alexas", KeyConditionExpression: "deviceId = :deviceId", …
Old Geezer
  • 14,854
  • 31
  • 111
  • 198
5
votes
1 answer

DynamoDB Update - ExpressionAttributeNames can only be specified when using expressions

I need another set of eyes on this. For the life of me I see no issues with this parameter set, used for Dynamo DocumentClient, update method - (here:…
5
votes
2 answers

DynamoDB Python Query with Pagination (not scan)

I am using the following code to query and paginate through a DynamoDB query: class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): return str(o) return…
dandev91
  • 1,691
  • 3
  • 22
  • 34
5
votes
3 answers

DynamoDB Mapper annotation for Object which has list of another object

I am trying to create a dynamoDBMapper annotation for the below case. I have EmployeeLevelTrail which is a class of a Employee level record @DynamoDBTable(tableName = TABLE_NAME) public class EmployeeData { public final static String TABLE_NAME…
5
votes
1 answer

DynamoDB best practice for querying attribute with few values

I have a table in DynamoDB which contains attributes like this: OrderId, OrderJson,OrderStatus. The value of order status can be 0 or 1. I need to be able to update the status of the specified order and also to fetch orders based on the status…
Aram Mkrtchyan
  • 415
  • 1
  • 5
  • 15
4
votes
1 answer

DynamoDB error when update Date: Unsupported type passed: ... Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute

When I would like to insert new document into DynamoDB database, Date type property date is inserted without any problem. table.create("User", { accountName: "johndoe", email: "test@test74.test", date: new Date(), // Date is inserted…
klaucode
  • 180
  • 1
  • 10
1 2
3
82 83