Questions tagged [amazon-dynamodb-index]

251 questions
0
votes
1 answer

Dynamodb GSI for boolean value

So I have this notifications table with the following columns: PK: (which stores the userId) sentAt: (which stores the date the notifications was sent) data: (which stores the data of the notification) Read: (a boolean value which tells if the user…
0
votes
1 answer

scanindexforward() not working as expected while doing pagination in dynamodb

I am using DynamoDBEnchancedAsyncClient to query DynamoDB using GSI and pagination. Below is the code that I am using to achieve the same. I am tying to limit the number of items per page and number of pages sent to the subscriber of the Mono using…
0
votes
1 answer

What is the WCU of deleting an item with TTL which also exist in a GSI?

I would like to know what are the total WCUs consumed to delete an item less than 1kb which has a TTL in the main table and GSI? About TTL, we know that after the date and time of the specified timestamp, DynamoDB deletes the item from the table…
radrt
  • 45
  • 7
0
votes
1 answer

Any downside of having SortKey for GSI in dynamoDB

I want to create a DynamoDB table with a GSI. For this GSI, currently I need only PartitionKey because I want to query by only one attribute. But in future I may need to query by other attributes. So, I am thinking of adding a SortKey just in case…
0
votes
1 answer

How to structure Dynamo 'posts' table(s) to enable querying by user ID OR post timestamp?

I'm working on a "Buffer-like" (scheduled posts) type application and looking into Dynamo as the data store. I'm more familiar with SQL and am having a little trouble wrapping my head around how best to accomplish this in Dynamo (or if Dynamo is…
0
votes
2 answers

DynamoDB index/query questions

I need to create a table with the following fields : place, date, status My keys are parition key - place , sort key - date Status can be either 0 or 1 Table has approximately 300k rows per day and about 3 days worth of data at any given time, so…
0
votes
1 answer

PynamoDB Creating GSI and LSI Python Error

Hello All hope you are fine i am reaching out for some help as I am learning and experimenting with pynamodb Goal to create LSI and GSI Phase 1: create index and popular with fake data import os import boto3 import json from faker import…
0
votes
0 answers

In DynamoDB, how to relate an entity with itself, via another key or attribute?

Let's say I have a DynamoDB table modelling two entities: people and the cities they have visited, in a many-to-many relationship. personName could be the primary key, and cityName could be the sort key. We could also invert the index to run get…
0
votes
1 answer

How to query list of maps in DynamoDB table

I have a dynamo db table with InvId (Primary Partition Key) and PgNo (Primary Sort Key). There is an item in the table called Details which is a list of maps and every map has an attribute called ChargeId. How can I query the map having a particular…
0
votes
0 answers

Query DynamoDB by List of Global Secondary Index

I have a GSI setup on my personId field: @DynamoDBIndexHashKey(attributeName = "personId", globalSecondaryIndexName = "personIndex") private UUID personId; Now the use case is where I will get a request containing List personsIds and I need to…
0
votes
0 answers

Sorting on GSI Range key gives Unsupported type passed error

From what I understand I am able to use a Global Secondary Index in order to sort results of an attribute, although I'm having some trouble implementing this. Essentially, the table uses the imdb of films as the Hash key, and the User ID as a Sort…
0
votes
2 answers

How to convert a DynamoDB Json in a regular JSON in Python?

I get a json from DynamoDB and that is the format: payload_stack = {'Records': [{'eventID': '123456', 'eventName': 'INSERT', 'eventVersion': '1.1', 'eventSource': 'aws:dynamodb', 'awsRegion': 'sa-east-1', …
0
votes
1 answer

DynamoDB gt() query on GSI

I am trying to get a gt() query working with a DynamoDB GSI My Cloudformation is as follows - Resources MyTable: Properties: AttributeDefinitions: - AttributeName: pk AttributeType: S - AttributeName: sk …
Justin
  • 4,649
  • 6
  • 33
  • 71
0
votes
1 answer

Unable to update the item in DynamoDB using the GSI

I have the following structure in my dynamodb table:- id: partition_key user_id: GSI Following is my Lambda where I'm trying to get the value of user_id from the client in the user object (in JSON) and then trying to update the Dynamodb item using…
0
votes
0 answers

DynamoDB: Enum as partition key giving error "Missing the key id in the item" when putItem

I am using the enum as the partition key and my model looks like below @DynamoDbBean public class Item { public enum Key { KEY_A(false), KEY_B(2), private final Object defaultValue; private Key(Object…