Comparing version 0.7.3 to 0.7.4
@@ -60,7 +60,7 @@ var typ = require('typ') | ||
case 'IN': | ||
return function(item) { return values.indexOf(item[key]) } | ||
return function(item) { return values.indexOf(item[key]) != -1 } | ||
case 'NOT_CONTAINS': | ||
return function(item) { return !item[key].indexOf(values[0]) } | ||
return function(item) { return item[key].indexOf(values[0]) == -1 } | ||
case 'CONTAINS': | ||
return function(item) { return item[key].indexOf(values[0]) } | ||
return function(item) { return item[key].indexOf(values[0]) != -1 } | ||
case 'NULL': | ||
@@ -67,0 +67,0 @@ return function(item) { return !item.hasOwnProperty(key) } |
@@ -28,2 +28,4 @@ // Copyright 2013 The Obvious Corporation | ||
* BS: (Array.<string>|undefined), | ||
* M: (Object|undefined), | ||
* L: (Array|undefined), | ||
* N: (string|undefined), | ||
@@ -143,3 +145,3 @@ * NS: (Array.<string>|undefined), | ||
* @param {!AWSAttributeValue} obj | ||
* @return {string|number|Array.<string>|Array.<number>|boolean} a javascript primitive value | ||
* @return {string|number|Array.<string>|Array.<number>|boolean|Object} a javascript primitive value | ||
*/ | ||
@@ -146,0 +148,0 @@ function objectToValue(obj) { |
{ | ||
"name": "dynamite", | ||
"description": "promise-based DynamoDB client", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"homepage": "https://github.com/Medium/dynamite", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
@@ -723,1 +723,25 @@ // Copyright 2013 The Obvious Corporation | ||
}) | ||
builder.add(function testQueryFilterIn(test) { | ||
db.getTable('user').setData({ | ||
'userA': { | ||
1: {userId: 'userA', column: '1', age: 27, name: 'Ringo'}, | ||
2: {userId: 'userA', column: '4', age: 28, name: 'George'}, | ||
3: {userId: 'userA', column: '3', age: 29, name: 'Paul'}, | ||
4: {userId: 'userA', column: '2', age: 30} | ||
} | ||
}) | ||
var filter = client.newConditionBuilder() | ||
.filterAttributeIn('name', ['Ringo', 'George']) | ||
return client.newQueryBuilder('user') | ||
.setHashKey('userId', 'userA') | ||
.withFilter(filter) | ||
.execute() | ||
.then(function (data) { | ||
test.deepEqual(['George', 'Ringo'], data.result.map(function (r) { | ||
return r.name | ||
}).sort()) | ||
}) | ||
}) |
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
216335
5564