Query order/limit enforced. Scan limit enforced
This commit is contained in:
parent
41b9bb34f3
commit
372e2d8729
@ -239,6 +239,11 @@ class DynamoHandler(BaseResponse):
|
|||||||
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
|
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
|
||||||
return self.error(er)
|
return self.error(er)
|
||||||
|
|
||||||
|
items.sort(key=lambda item: item.range_key)
|
||||||
|
limit = self.body.get("Limit")
|
||||||
|
if limit:
|
||||||
|
items = items[:limit]
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"Count": len(items),
|
"Count": len(items),
|
||||||
"Items": [item.attrs for item in items],
|
"Items": [item.attrs for item in items],
|
||||||
@ -270,6 +275,10 @@ class DynamoHandler(BaseResponse):
|
|||||||
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
|
er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
|
||||||
return self.error(er)
|
return self.error(er)
|
||||||
|
|
||||||
|
limit = self.body.get("Limit")
|
||||||
|
if limit:
|
||||||
|
items = items[:limit]
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"Count": len(items),
|
"Count": len(items),
|
||||||
"Items": [item.attrs for item in items],
|
"Items": [item.attrs for item in items],
|
||||||
|
Loading…
Reference in New Issue
Block a user