Questions tagged [amazon-dynamodb]

1

votes
1

answer
83

Views

How to set on-demand capacity for a DynamoDB table using JavaScript SDK

Amazon DynamoDB has two read/write capacity modes for processing reads and writes on tables: On-demand Provisioned (default, free-tier eligible) This is how I create provisioned table var AWS = require('aws-sdk'); AWS.config.update({ region: 'us-west-2', endpoint: 'http://localhost:8000' }); var dyn...
matchish
1

votes
1

answer
42

Views

Rookie can't locate connection string for DynamoDB in AWS

I can't believe I have to ask this but where is the connection string in AWS so that I can connect to my DynamoDB? My code snippet below shows you want I need. Looking at the 'DynamoDB dashboard' page within AWS I can't see it. The only thing that stands out is the Amazon Resource Name (ARN) val...
James
1

votes
2

answer
63

Views

How does invalidation work in AWS DynamoDB DAX multi-region

We are using DynamoDB global tables and planning to use DAX on the top of DynamoDB to enable caching. But I don't see any mention of how DAX invalidation will take place in multi-region setup. For example, let's say there are 2 clusters, one in us-west-2 and one in us-east-2. If we update something...
hello123
1

votes
2

answer
24

Views

Update item in dynamoDB

I am trying to update items in DynamoDB table. The code that I have written is updating the item but when I add a column with the header 'source/target', it is giving a 'ValidationException' Exception. Code used to update - dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('test') respon...
TeeKay
0

votes
0

answer
3

Views

Dynamodb design recommendation

Use Case : Company X and Company Y publishes product information . For ex Company X publishes product information like Product X, Product Y and Company Y publishes product information Z and K. Consumer likes Product X from Company X and Product Z from Company K. Based on consumer liking, we need...
Siv
0

votes
0

answer
13

Views

How to pass null value from a json to dynamodb

I want to pass the value one by one to lambda function and store that the data into dynamodb but while doing that when I save the first value, the value says that the value can't be null. I have tried the following things: Add the convertEmptyValues: true var doClient = new AWS.DynamoDB.DocumentClie...
Abhishek Gupta
1

votes
0

answer
16

Views

Amazon Dynomo DB: BatchPutItem because of APPSYNC_ASSUME_ROLE and type mismatch error

I'm building a React app using AWS Amplify. I use Cognito User Pools for by authentication and a GraphQL AppSync backend for my backend. I'm trying to write a custom resolver to batch mutations. Here is the schema that I use: type Todo @model @auth(rules: [{ allow: owner }]) { id: ID! title: String!...
J. Hesters
1

votes
1

answer
698

Views

DyanamoDB SCAN with nested attribute

Can I scan DynamoDB by 'order.shortCode', in the given example. The console is indicating I can't with dot notation, and I can't find any documentation on it. { 'key2': 'cj11b1ygp0000jcgubpe5mso3', 'order': { 'amount': 74.22, 'dateCreated': '2017-04-02T19:15:33-04:00', 'orderNumber': 'cj11b1ygp...
Robin Masters
1

votes
1

answer
1.1k

Views

DynamoDB - Remove key-value pair from Map

{ 'ExHashKey' : 'id_asdfqe123' 'Data' : { 'key1' : 'val1', 'key2' : 'val2' } } I'm trying to delete elements from the 'Data' map by key. Is there a way to do this other than just retrieving the entire item, making changes, and then writing it to the DB again? I've poked around the updateExpressio...
blucaroni
1

votes
2

answer
1.8k

Views

How to Filter Nested Array Object in DynamoDB

I am very beginner to AWS DynamoDB, I want to scan the DynamoDB with SENDTO.emailAddress = '[email protected]' as FilterExpression. The DB Structure looks like this { ID NAME MESSAGE SENDTO[ { name emailAddress } ] } A Sample Data { ID: 1, NAME: 'HELLO', MESSAGE: 'HELLO WORLD!', SENDTO: [ { name: 'Fi...
Narayanan Ramanathan
1

votes
2

answer
41

Views

Error when using getItem with DynamoDB with the node aws-sdk library

The following code produces this error message when trying to access my AWS DynamoDB table. The table is called customers and the column is called email with a value of '[email protected]'. I've copied this code straight out of AWS examples available here https://github.com/awsdocs/aws-doc-sdk-examp...
James
1

votes
1

answer
36

Views

dynamodb get item typescript hell

Can anyone explain how to use GetItemInput type when calling DocumentClient.get, if i pass in an object of any type get works but if i try and strongly type the params object i get an error ValidationException: The provided key element does not match the schema Here is my lambda function code wher...
Mingo
0

votes
1

answer
14

Views

Storing data in a dynamodb

I need to store varying keys of data in a dynamodb table. I am using node.js / aws lambda / dynamodb. The information I am trying to store would look something like this: [ { 'boxname':'foo', 'contents': [ { 'itemid':'1', 'itemname':'apple', 'itemamount':'7', 'itemdateadded':'03-17-2019' } ] 'b...
wtj
0

votes
1

answer
30

Views

typescript return triggering before await response

I am working with Serverless to create a REST get endpoint. The intention is to call this endpoint and return a value from the DynamoDB query (the body tag to be specific). Problem I'm having is that the response from this endpoint is {} when its invoked. I believe that is because the return is bein...
BrandonW
0

votes
0

answer
2

Views

How to create a DynamoDB-Local Docker instance with exported table and rows?

I got this real DynamoDB instance in my AWS account that is already populated woth tables and rows. I need to create a test scenario that will run DynamoDB local, so I'm using Docker for that purpose. I exported a table with some rows of my Real DynamoDB. What i want to achieve is run the Docker ins...
Victor Ferreira
3

votes
2

answer
65

Views

DynamoDB put Item is not getting mocked using MockiTo & PowerMock

Below is the code which I am trying to Mock, this.dynamoDb.getTable(PropertyUtil.get(Constants.SOME_TABLE_NAME)) .putItem( new PutItemSpec() .withItem(new Item().withString('ID', pId).withString('eId', pEId) .withString('activeInd', pActiveInd))); What I have tried is below, mockStatic(AmazonDynamoD...
ViS
0

votes
0

answer
11

Views

Alexa skill async await fetching data from DynamoDB

The following code is my launch handler in my Alexa skill and I have a variable named x inside of my handler. I am trying to set x to data that I'm getting from dynamoDB and to use it outside of the get function (I got the function from https://docs.aws.amazon.com/amazondynamodb/latest/developerguid...
user10796158
0

votes
0

answer
5

Views

Update in DynamoDB not working with AWS Lambda

I've managed to write a complete script in NodeJS in AWS Lambda, although I'm falling at the final hurdle when it comes to an update query, here's my code: var update_params = { TableName:'matches', Key: { 'match_id': match.id }, UpdateExpression: 'SET #status = :status, updated_at = :modified', Exp...
Curtis
1

votes
1

answer
835

Views

Creating dynamodb table using aws cli “--cli-input-json”

i have been trying to create a dynamo db table using the following json(testbootstraptable.json) file: { 'AttributeDefinitions': [ { 'AttributeName': 'test1', 'AttributeType': 'S' }, { 'AttributeName': 'test2', 'AttributeType': 'S' } ], 'TableName': 'BOOTSTRAP_TEST_TBL', 'KeySchema': [ { 'AttributeN...
sophist_pt
1

votes
2

answer
2k

Views

AWS: Trigger event if DynamoDB table row is not updated in the last 30 minutes

I have to set up a management on an AWS process. To keep things simple I have some clients that sends me heartbeat, let's say every 5 minutes, via SOAP requests to my SOAP server deployed on an Elastic Beanstalk NodeJS app. Every time I receive a heartbeat, I store the last time I received it on a D...
Mattia Costamagna
1

votes
1

answer
256

Views

How to get aws dynamodb ConsumedCapacity in node.js?

I seen aws document and i have insert parameter ReturnConsumedCapacity but not response ConsumedCapacity object... (use dynamodb local) What was the mistake I made? var params = {}; params.TableName = this.tableName; params.Limit = 100; params.ReturnConsumedCapacity = 'TOTAL'; var items = []; var sc...
young
1

votes
1

answer
457

Views

Bulk add ttl column to dynamodb table

I have a use case where I need to add ttl column to the existing table. Currently, this table has more than 2 billion records. Is there any existing solution build around same? Or Should be emr is the path forward?
Vivek Goel
1

votes
3

answer
1.6k

Views

How to fetch all items of a particular Attribute from an AWS DynamoDB Table using Python boto3?

I am pretty new to AWS Dynamodb. I am using python's boto3 to fetch all items of a particular attribute (say, Attribute name is 'Name') from the dynamodb table. Although there are other attributes too in the table like 'Email', 'Profession'. I need to fetch or get all items only of the attribute '...
FCoding
1

votes
1

answer
404

Views

How to use DynamoDBStreamEvent Trigger Lambda when only update certain attribute

I use serverless framework to deploy cloudFormation. I want to trigger lambda to deleteObject on my S3 bucket after I update my DynamoDB Table with certain attribute, eg. my table has account, user, icon, I only want when I update icon, it trigger Lambda to delete my iconObject on S3 bucket. As I re...
ckky1213
1

votes
2

answer
219

Views

Appsync Resolver UpdateItem ignore null args?

I am doing this in my Appsync Resolver: { 'version' : '2017-02-28', 'operation' : 'UpdateItem', 'key' : { 'pk' : { 'S' : 'Container' }, 'id' : { 'S' : '${ctx.args.id}' } }, 'update' : { 'expression' : 'SET #name = :name, description = :description', 'expressionNames': { '#name' : 'name' }, 'expressi...
rygo6
1

votes
1

answer
110

Views

erlcloud- dynamodb2, manage counters (update_item)

I'm having a bit of a hard time finding an answer to the problem- how can i update a value in aws ddb2 using erlang and erlcloud library. i am managing a table for different counters, and i neet to add one (i++), to one of the records. in the doc they suggest {ok, Item} = erlcloud_ddb2:update_ite...
gCoh
1

votes
1

answer
1k

Views

dynamodb updateItem set an attribute to an object

I have a table that has an attribute which is actually a JSON list. var myItem = { name: 'myname', tasks: [ { key1: 'value1', key2: 'value2' } ] } I put the myItem into the table like this, and this seems to work fine. var params = { TableName: 'runs', Item: myItem }; dynamodbDoc.put( params, ... I...
zsimpson
1

votes
2

answer
535

Views

Access dynamodb using sdk-for-php

require 'config.php'; require __DIR__ . '/vendor/autoload.php'; $sdk = new Aws\Sdk([ 'region' => 'us-east-1', 'version' => 'latest', 'credentials' => array( 'key' => $global_access_key, 'secret' => $global_secret_key, ), ]); $dynamodb = $sdk->createDynamoDb(); $response = $dynamodb->getItem([ 'T...
Master Yoda
1

votes
1

answer
805

Views

Amazon DynamoDB Atomic Writes

I have a list of Lambda worker functions (say 1000), each running simultaneously and doing its job. To be able to figure out the end result of all workers I have come up with this idea. Before starting the job and spawning the Lambda worker functions, I save a record in DynamoDB, for example two att...
Shikasta_Kashti
1

votes
1

answer
1.8k

Views

Cannot delete item from DynamoDB table (java)

I've been attempting to delete an item from a table in DynamoDB through java code, but every attempt I've made results in the same error: com.amazonaws.AmazonServiceException: The provided key element does not match the schema (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationExce...
A.Atanassov
1

votes
1

answer
284

Views

DynamoDb safe update

I am trying to update a counter in my simple database (one key, one numeric value). Atomic counters seem the natural solutions, but I need thread safe updates, i.e. I need to make sure that updates do not interfere with each other. This answer seem to suggest that I need to double check that the dat...
meto
1

votes
2

answer
2.5k

Views

InvalidSignatureException when using boto3 for dynamoDB on aws

Im facing some sort of credentials issue when trying to connect to my dynamoDB on aws. Locally it all works fine and I can connect using env variables for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION and then dynamoConnection = boto3.resource('dynamodb', endpoint_url='http://loca...
KalleJuhans
1

votes
1

answer
137

Views

DynamoDB Global Secondary Index to increase performance

I am designing an application for tracing call activity. Each call can be either terminated or activated. An application will query the database every minute to generate a list of activate calls. There can be up to 1000 calls per second. How should I design my database? Should I have a 'Call' table...
ljaerj
1

votes
1

answer
915

Views

How to delete specific item in DynamoDB

I have a list of elements in database that looks like this: User ---inventory(Map) ------items(List) ---------item0(Map) ---------item1(Map) ---------item2(Map) I would like to delete one of the items based on item characteristics (e.g. item.id) How can I do that with conditional expression? From...
Mikhail Naumov
1

votes
1

answer
116

Views

DnnamoDB Table with hash key and no range key

I have for example an artist and artworks. So in my artist table, there is only a unique hash key (artist id) and no range key. I then have a table for artworks with a hash key (artist id) and rage key (artwork id). I am trying to understand how dynamodb will handle the artist table as far as part...
Jeff M
1

votes
1

answer
94

Views

DynamoDB: Is setting ReturnValues to “ALL_NEW” a good practice while updating?

I have my database setup with DynamoDB. I want to update an item in a table and return the new values because the callback does some processing based on the new data. So, is it efficient to request for the new data in ReturnValues? Is this a good practice or is there something better I can do?
Parth
1

votes
0

answer
17

Views

“aws dynamodb list-tables” is not working on ec2 instance

I've created a node.js application which connects to DynamoDB. Everything is working fine locally Now I'm trying to setup on AWS servers. First I've created DynamoDB tables from AWS DynamoDB console. It is working fine. I've created a new role from IAM management console > Roles to access DynamoDB....
Amit Kumar Gupta
1

votes
1

answer
60

Views

dynamodb partition key for questions table

The main table for my app will hold questions. Which one of the below options would be a better choice for partition key? Keep the question itself as the partition key. The questions can be upto 200 chars long use redis to keep track of a counter and use that as partition key
Raj Garu
1

votes
1

answer
317

Views

AWS Dynamo DB supports embedded documents or not?

I was following a lecture in which it says Difference between DynamoDb and Mongo is that DynamoDB does not support embedded documents So i thought something like this Item: { 'Artist':'No One You Know', 'SongTitle':'Call Me Today', 'AlbumTitle':'Somewhat Famous', 'Year': 2015, 'Price': 2.14, 'Genre...
Aishwat Singh
1

votes
1

answer
142

Views

AWS DynamDB Conditional Item Deletion

I have a DynamoDB table with one attribute as a primary key ItemName. Every attribute that is added to the table is named using the current UTC timestamp. I want to do a conditional deletion of the item when I delete the last attribute which will check if there's another attribute other than ItemNam...
Tal87

View additional questions