Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batchGetItem broken #67

Open
peebles opened this issue Dec 16, 2016 · 0 comments
Open

batchGetItem broken #67

peebles opened this issue Dec 16, 2016 · 0 comments

Comments

@peebles
Copy link

peebles commented Dec 16, 2016

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}"
    }
  ]
}
peebles pushed a commit to peebles/node-dynamodb that referenced this issue Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant