viewmodel
Advanced tools
Comparing version 1.7.5 to 1.7.6
@@ -306,4 +306,18 @@ 'use strict'; | ||
if(_.isPlainObject(valueSearchedFor)) { | ||
result = _.merge(result, createDynamoParams(valueSearchedFor, dotNotatedTargetAttribute)); | ||
result.expressionAttributeNames['#' + key] = key; | ||
result.expressionAttributeNames['#' + key] = key; | ||
const newCondition = createDynamoParams(valueSearchedFor, dotNotatedTargetAttribute); | ||
result.expressionAttributeNames = _.merge( | ||
result.expressionAttributeNames, | ||
newCondition.expressionAttributeNames); | ||
result.expressionAttributeValues = _.merge( | ||
result.expressionAttributeValues, | ||
newCondition.expressionAttributeValues); | ||
if (!_.isEmpty(newCondition.filterExpression)) { | ||
result.filterExpression = result.filterExpression.concat( | ||
_.isEmpty(result.filterExpression) ? '' : ' AND ', | ||
newCondition.filterExpression); | ||
} | ||
} else { | ||
@@ -314,6 +328,10 @@ var attributeVariable = ':' + dotNotatedTargetAttribute.replace(/(\.|#)/g, ''); | ||
if (result.filterExpression !== '') { | ||
result.filterExpression = result.filterExpression + ' AND '; | ||
result.filterExpression = result.filterExpression.concat(' AND '); | ||
} | ||
result.filterExpression = result.filterExpression + dotNotatedTargetAttribute + ' = ' + attributeVariable; | ||
result.filterExpression = result.filterExpression.concat( | ||
dotNotatedTargetAttribute, | ||
' = ', | ||
attributeVariable); | ||
result.expressionAttributeValues[attributeVariable] = valueSearchedFor; | ||
@@ -320,0 +338,0 @@ result.expressionAttributeNames['#' + key] = key; |
{ | ||
"author": "adrai", | ||
"name": "viewmodel", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -0,1 +1,4 @@ | ||
## [v1.7.6](https://github.com/adrai/node-viewmodel/compare/v1.7.5...v1.7.6) | ||
- Dynamodb filter expression fix [#55](https://github.com/adrai/node-viewmodel/pull/56) thanks to [Glockenbeat](https://github.com/Glockenbeat) | ||
## [v1.7.5](https://github.com/adrai/node-viewmodel/compare/v1.7.4...v1.7.5) | ||
@@ -2,0 +5,0 @@ - Switching DynamoDB scan to FilterExpression [#55](https://github.com/adrai/node-viewmodel/pull/55) thanks to [Glockenbeat](https://github.com/Glockenbeat) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135303
3665