Skip to content

batchGetItem broken #67

Description

@peebles

See lines 495+:

          if (parts.length == 1) {
            var smartResponse = res.Responses[table];
            cb(null, smartResponse, consumedCapacity);
          }

Both parts and table are completely out of scope. I am getting one item from multiple tables, and because of this wild "parts.length" check, and out of scope table reference, I am getting only the last item from the last of my tables in the "smartResponse".

Here's what is coming back from AWS:

{ binnedby_day: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_hour: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_raw: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_month: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_year: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_week: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] },
  binnedby_quarter: { ConsumedCapacityUnits: 0.5, items: [ [Object] ] } }

and here is what is coming back from this library:

{
  "ConsumedCapacityUnits": 0.5,
  "items": [
    {
      "cameraId": "BkpwhVC9",
      "timestamp": 1467349200000,
      "metricType": "InOut",
      "timezone": "US/Central",
      "data": "{\"in\":1,\"out\":1}"
    }
  ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions