awspilot / dynamodb-oop

Speak fluent DynamoDB, write code with fashion, I Promise() 😃
https://awspilot.dev
MIT License
119 stars 28 forks source link

Empty array getting returned from DB #27

Closed randeepbhatia closed 7 years ago

randeepbhatia commented 8 years ago

Hi I believe its part of a the recent update, of all my dynamodB requests, I see one last object to be completely empty. It's happening with the scan operation.

DynamoDB.table('TableName') .scan (function (err, data) { if (err) { cb(err, null); } cb(null, data); });

adrianpraja commented 8 years ago

sorry for the late reply, I just noticed your post now,

can you provide details on how to reproduce this ?

also note that your error handling is missing the return:

if (err)
   return cb(err, null )
adrianpraja commented 7 years ago

Im closing it, I'm supposing empty data is because of the leftout "return"