diff --git a/src/lib/aws-translators.coffee b/src/lib/aws-translators.coffee index 14044ac..c831b5b 100644 --- a/src/lib/aws-translators.coffee +++ b/src/lib/aws-translators.coffee @@ -111,6 +111,7 @@ module.exports.scan = (params, options, callback, keySchema) -> Limit: params.limit TotalSegments: params.totalSegment Segment: params.segment + ExclusiveStartKey: params.ExclusiveStartKey scanFilterFunc = (filter) -> obj = awsParams.ScanFilter @@ -125,7 +126,10 @@ module.exports.scan = (params, options, callback, keySchema) -> @parent.dynamo.scanAsync(awsParams) .then (data)-> - dataTrans.fromDynamo(data.Items) + result = + Items: dataTrans.fromDynamo(data.Items), + Count: data.Count, + LastEvaluatedKey: data.LastEvaluatedKey .nodeify(callback) module.exports.putItem = (obj, options, callback) -> diff --git a/test/src/aws-translators.coffee b/test/src/aws-translators.coffee index 1e5f303..7e0612f 100644 --- a/test/src/aws-translators.coffee +++ b/test/src/aws-translators.coffee @@ -310,7 +310,11 @@ describe 'aws-translators', () -> hashKeyName: 'bar' hashKeyType: 'S' .then (data) -> - expect(data).to.deep.equal(rofl: 'lol') + expect(data).to.deep.equal({ + Count: undefined + Items: {rofl: 'lol'} + LastEvaluatedKey + }) it 'should call getItem of aws', () -> sandbox.spy(dynastyTable.parent.dynamo, "scan")