From c9f43c885a42db97f975f02171a4617039a09180 Mon Sep 17 00:00:00 2001 From: Paul Craciunoiu Date: Thu, 7 Jan 2016 12:39:18 -0700 Subject: [PATCH] Support Select=COUNT when querying. --- moto/dynamodb2/responses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/dynamodb2/responses.py b/moto/dynamodb2/responses.py index 20c45560d..901ae8e92 100644 --- a/moto/dynamodb2/responses.py +++ b/moto/dynamodb2/responses.py @@ -330,9 +330,10 @@ class DynamoHandler(BaseResponse): result = { "Count": len(items), - "Items": [item.attrs for item in items], "ConsumedCapacityUnits": 1, } + if self.body.get('Select', '').upper() != 'COUNT': + result["Items"] = [item.attrs for item in items] # Implement this when we do pagination # if not last_page: