Amazon-Dynamodb [SOLVED]: How to get aws dynamodb ConsumedCapacity in node.js?

Amazon-Dynamodb [SOLVED]: How to get aws dynamodb ConsumedCapacity in node.js?

Home Forums Amazon Web Services Amazon Dynamodb Amazon-Dynamodb [SOLVED]: How to get aws dynamodb ConsumedCapacity in node.js?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #247022

    Cloudy Point
    Keymaster

    QuestionQuestion

    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 scanExecute = function() {
          dynamo.scan(params, function(err, result) {
            console.log(result); // not found ConsumedCapacity...
            if (err) {
              console.log(err);
              callback(new Error('dynamo scan error'));
            } else if (result.Count === 0) {
              callback(null, undefined);
            } else {
              items = items.concat(result.Items);
              if (result.LastEvaluatedKey) {
                params.ExclusiveStartKey = result.LastEvaluatedKey;
                scanExecute();
              } else {
                callback(null, items);
              }
            }
        });
      }
      scanExecute();
    

    #247023

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    When you run the DynamoDB local instance, the consumed capacity will not be tracked.

    Consumed capacity units are not tracked. In operation responses, nulls
    are returned instead of capacity units.

    Source: https://stackoverflow.com/questions/47973571/how-to-get-aws-dynamodb-consumedcapacity-in-node-js
    Author: notionquest
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.