Questions tagged [dynamodb-queries]

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

1232 questions
3
votes
0 answers

Does DynamoDB protect against parallel operations on the same document

Say that I want to make frequent updates to an object in DynamoDB, and I've implemented optimistic locking where we (1) read the document; (2) perform some operations including a version increment; and (3) do a conditional put where the condition is…
3
votes
0 answers

DynamoDB Conditional Update Expression for Nested Objects

Case: I am aware this question is a bit long (sorry for that). I think a detailed description explains my case better. I receive device data from a streaming endpoint. Each payload in stream includes multiple data entity. I create following…
ylcnky
  • 775
  • 1
  • 10
  • 26
3
votes
2 answers

Dynamo db pagination

I want to use pagination in dynamodb using aws-sdk DocumentClient() I am using node.js. What I want to do is get first 10 items and then return these value to the user. After that user makes a new request in which he tell the server to start from 10…
Nouman Dilshad
  • 1,014
  • 13
  • 16
3
votes
1 answer

DynamoDB - How to handle updates using adjacency list pattern?

So, in DynamoDB the reccomended approach to a many-to-many relationship is using Adjacency List Pattern. Now, it works great for when you need to read the Data because you can easily read several items with one request. But what if I need to…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
3
votes
1 answer

DynamoDB - What happens when I delete a object in a GSI? Does it "Cascade" to the main table?

Let's say in my main table I have objects that have the following pattern : Partition Key = user_user@email.com Range Key = project_001 Role = owner It's a simple object that says what is the role if a specific user in a specific project. But then…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
3
votes
2 answers

Modeling Relational Data in DynamoDB (nested relationship)

Entity Model: I've read AWS Guide about create a Modeling Relational Data in DynamoDB. It's so confusing in my access pattern. Access Pattern +-------------------------------------------+------------+------------+ | Access Pattern …
3
votes
1 answer

How to check and then update AWS dynamoDB item in node.js?

Here is an example. I am using AWS Lambda function in Node.JS. This is the object in DynamoDB: { email: "johndoe@gmail.com", name: "John Doe", score: "12" } Now I want to first check what his saved score is. If his current score is more…
3
votes
2 answers

How can I query by sort key in AWS DynamoDB?

I have a database of users, and I'd like to return all users with the last name X. I currently have "last" as the sort key for my table. I'm running the following code, but getting a "Query condition missed key schema element" error. var params = {…
3
votes
1 answer

update or insert item based on existence in table dynamodb python

The Problem I'm trying to look into table item by item, so that if an item already exists then I should be able to update it, if not then I should be able to insert it. However, I learnt that update works like upsert(update/insert) as well. My case…
T3J45
  • 717
  • 3
  • 12
  • 32
3
votes
2 answers

How to get the total number of records count present in dynamodb using Resolver in Appsync

I am new to Dynamodb and Appsync I have one table named User with fields id and name as follow type User { id: ID! // auto-generated name: String } By using the mutation I inserted 5 records. Now my query is how do I get the count of the number of…
3
votes
2 answers

query dynamoDB for the latest entry of every hash key

I have a dynamoDB table where I store sensor events. HASH KEY: sensor id RANGE KEY: timestamp sensor info I now need a query for the latest event of every sensor. The only solution I can come up with is to query the latest event for each sensor…
3
votes
0 answers

Querying many-to-many in DynamoDB with Node.js

I was reading about how to model many-to-many relationships in DynamoDB from this article: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-adjacency-graphs.html Let's say that the requirement is to display a list of all Bills…
osotorrio
  • 960
  • 1
  • 11
  • 30
2
votes
1 answer

DynamoDB paginated data retrieval

I have the following columns and its purpose. id -> stores the timestamp of modification authorName -> saves the user name who have modified authorEmail -> saves the user email who have modified version -> value denoting the version number Data ->…
2
votes
2 answers

DynamoDB unique primary key ConditionExpression

I am implementing a single table design in dynamodb and overloading keys. My current design allows for an email to be subscribed to a thread. This is a noSQL workbench screenshot: I am using EM#\ as the partition key and SB#\ as…
2
votes
1 answer

Passing multiple values to expression.in() of aws-sdk-go-v2 for DynamoDB

I am trying to pass a list of values to the 'IN' expression in aws-sdk-go-v2 and I cannot figure out how to do it dynamically. This is what it looks like now. func Find(colors []string) ([]Trip, error) { db := database.GetClient() filt :=…