Query order/limit enforced. Scan limit enforced

This commit is contained in:
Jeff Gregory 2014-02-21 13:33:46 -08:00
parent 41b9bb34f3
commit 372e2d8729

View File

@ -239,6 +239,11 @@ class DynamoHandler(BaseResponse):
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
return self.error(er)
items.sort(key=lambda item: item.range_key)
limit = self.body.get("Limit")
if limit:
items = items[:limit]
result = {
"Count": len(items),
"Items": [item.attrs for item in items],
@ -270,6 +275,10 @@ class DynamoHandler(BaseResponse):
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
return self.error(er)
limit = self.body.get("Limit")
if limit:
items = items[:limit]
result = {
"Count": len(items),
"Items": [item.attrs for item in items],