amazon-dynamodb

dynamodb.put().promise() not returning the put object

China☆狼群 提交于 2020-12-08 05:23:27
问题 I am trying to make use of the async/await functionality with regard to aws and dynamo db. Below is an example of how to put an object pre asyn await, as you can see in the callback you have access to data which contains the put object. However in the second block of code which uses async and promise the result is an empty object, any thoughts? https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.03.html Non Promise Version var docClient = new AWS.DynamoDB

dynamodb.put().promise() not returning the put object

爱⌒轻易说出口 提交于 2020-12-08 05:22:46
问题 I am trying to make use of the async/await functionality with regard to aws and dynamo db. Below is an example of how to put an object pre asyn await, as you can see in the callback you have access to data which contains the put object. However in the second block of code which uses async and promise the result is an empty object, any thoughts? https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.03.html Non Promise Version var docClient = new AWS.DynamoDB

Auto-increment counter in Dynamo DB

北慕城南 提交于 2020-12-03 07:42:46
问题 I am trying to implement the auto -increment counter for hash key in dynamo db and my code fails for concurrent transactions. any help to implement the feature will be appreciated. I am new to stack over flow might be not able to specify it correctly. Any implementation will be helpful. 回答1: You have two options, using dynamo db atomic counters or using optimistic locking at the time of incrementing the counter. Documentation for atomic counters: https://docs.aws.amazon.com/amazondynamodb

Auto-increment counter in Dynamo DB

一笑奈何 提交于 2020-12-03 07:41:08
问题 I am trying to implement the auto -increment counter for hash key in dynamo db and my code fails for concurrent transactions. any help to implement the feature will be appreciated. I am new to stack over flow might be not able to specify it correctly. Any implementation will be helpful. 回答1: You have two options, using dynamo db atomic counters or using optimistic locking at the time of incrementing the counter. Documentation for atomic counters: https://docs.aws.amazon.com/amazondynamodb

DynamoDB - How to create map and add attribute to it in one update

最后都变了- 提交于 2020-12-02 10:42:35
问题 I want to create a new map if it doesn't exist and then add an attribute to that map. Something like this: SET #A = if_not_exists(#A, :emptyMap), #A.#B = :somevalue However doing the above gives me the error saying Two document paths overlap with each other The only other thing I am thinking to do is do TWO updates, one to create any empty maps and then another to set attributes. Is there a way to do it in a single update ? Update Another use case is creating maps that contain other maps.

DynamoDB - How to create map and add attribute to it in one update

余生颓废 提交于 2020-12-02 10:42:13
问题 I want to create a new map if it doesn't exist and then add an attribute to that map. Something like this: SET #A = if_not_exists(#A, :emptyMap), #A.#B = :somevalue However doing the above gives me the error saying Two document paths overlap with each other The only other thing I am thinking to do is do TWO updates, one to create any empty maps and then another to set attributes. Is there a way to do it in a single update ? Update Another use case is creating maps that contain other maps.

Creating a CloudWatch alarm based on a search expression

爷,独闯天下 提交于 2020-12-02 07:11:39
问题 I'm attempting to the do the following: I have a DynamoDB global table which publishes the ReplicationLatency metric. I want to create an alarm on the aggregate of the ReplicationLatency metric published for each region. The DDB table replicas exist in us-east-1, us-west-2 and us-west-1. In defining the CW alarm for each receiving region, I was under the assumption that I could a search expression. For example, here's the expression I see in the CloudWatch console. SEARCH('{AWS/DynamoDB

DynamoDB query() versus getItem() for single-item retrieval based on the index

不想你离开。 提交于 2020-12-01 08:01:44
问题 If I'm retrieving a single item from my table based on the indexed hash key, is there a performance difference between query() or getItem()? 回答1: getItem will be faster getItem retrieve via hash and range key is a 1:1 fit, the time it takes (hence performance) to retrieve it is limited by the hash and sharding internally. Query results in a search on "all" range keys. It adds computational work, thus considered slower. 回答2: In Amazon's DynamoDB, your performances are guaranteed whatever the

DynamoDB query() versus getItem() for single-item retrieval based on the index

﹥>﹥吖頭↗ 提交于 2020-12-01 07:58:45
问题 If I'm retrieving a single item from my table based on the indexed hash key, is there a performance difference between query() or getItem()? 回答1: getItem will be faster getItem retrieve via hash and range key is a 1:1 fit, the time it takes (hence performance) to retrieve it is limited by the hash and sharding internally. Query results in a search on "all" range keys. It adds computational work, thus considered slower. 回答2: In Amazon's DynamoDB, your performances are guaranteed whatever the

DynamoDB query on boolean key

五迷三道 提交于 2020-11-30 20:41:28
问题 I'm new to DynamoDB (and to noSQL in general) and am struggling a little to get my head round some of the concepts. One thing in particular is giving me some problems, which is around querying a table based on a boolean key. I realise that I can't created a primary or secondary index on a boolean key, but I can't see how I should ideally index and query a table with the following structure; reportId: string (uuid) reportText: string isActive: boolean category: string I would like to be able