mandarzope / loopback-connector-dynamodb

Loopback Adapter for DynamoDB
MIT License
14 stars 12 forks source link

No Longer Appends FilterExpression if it will be empty. #2

Closed SippieCup closed 7 years ago

SippieCup commented 7 years ago

With your latest implementation, a FilterExpression was always added to tableParams. Since DynamoDB doesn't like empty expressions and FilterExpressiont cannot contain keys, it would throw an error if only Hash or Hash/Sort keys were provided.

This checks to see if more than just keys are provided, and if so, includes the filter. Otherwise the filter is not added.

JSLint had a field day with the formatting. - Real changes are only lines 32-34 and lines 948-950.

P.s. I would love if you could open the project up to issues so we can start a discussion about a few things.