From d09bfb3967c76de6355335160e4e71d6e6ea9317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Ribeiro=20K=C3=BChn?= Date: Thu, 8 Apr 2021 15:48:36 -0300 Subject: [PATCH] Allow expressions to be optional --- dynamoDBtoCSV.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dynamoDBtoCSV.js b/dynamoDBtoCSV.js index 38ef6d0..3c86144 100644 --- a/dynamoDBtoCSV.js +++ b/dynamoDBtoCSV.js @@ -85,8 +85,8 @@ const query = { TableName: program.table, IndexName: program.index, Select: program.count ? "COUNT" : (program.select ? "SPECIFIC_ATTRIBUTES" : (program.index ? "ALL_PROJECTED_ATTRIBUTES" : "ALL_ATTRIBUTES")), - KeyConditionExpression: program.keyExpression, - ExpressionAttributeValues: JSON.parse(program.keyExpressionValues), + KeyConditionExpression: program.keyExpression || null, + ExpressionAttributeValues: program.keyExpressionValues? JSON.parse(program.keyExpressionValues): null, ProjectionExpression: program.select, Limit: 1000 };