aerospike
Advanced tools
Comparing version 5.2.2 to 5.3.0
@@ -210,3 +210,3 @@ // ***************************************************************************** | ||
if (ctx != null) { | ||
return ((ctx[0].id & LIST_INDEX) === 0) ? exp.type.MAP : exp.type.LIST | ||
return ((ctx.items[ctx.items.length - 1][0] & LIST_INDEX) === 0) ? exp.type.MAP : exp.type.LIST | ||
} | ||
@@ -213,0 +213,0 @@ return type |
@@ -87,4 +87,4 @@ // ***************************************************************************** | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {Object} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (integer expression) | ||
@@ -102,6 +102,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {Object} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -121,7 +121,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {Object} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -142,6 +142,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Values list expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Values list expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -161,7 +161,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Values list expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Values list expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -182,8 +182,8 @@ */ | ||
* | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Values list expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @return {AerospikeExp} (expression) | ||
@@ -205,7 +205,8 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (valueType expression) | ||
@@ -225,6 +226,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -244,7 +245,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -265,7 +266,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (valueType expression) | ||
@@ -285,6 +286,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -304,7 +305,7 @@ */ | ||
* | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @return {AerospikeExp} (expression) | ||
@@ -328,6 +329,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -345,6 +346,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value List items expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} value List items expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -362,7 +363,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -381,7 +382,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value List items expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} value List items expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -400,7 +401,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -419,7 +420,8 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional list write policy. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -438,4 +440,4 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -451,5 +453,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {number} order Sort order flags. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {number} order Sort order flags. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -466,5 +468,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -482,5 +484,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} values Values list expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} values Values list expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -500,6 +502,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -518,6 +520,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -537,7 +539,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -557,5 +559,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -573,5 +575,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -589,6 +591,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -607,5 +609,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -623,5 +625,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -639,6 +641,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin List bin or list value expression. | ||
* @return {AerospikeExp} (list expression) | ||
@@ -645,0 +647,0 @@ */ |
@@ -77,7 +77,7 @@ const as = require('bindings')('aerospike.node') | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -96,6 +96,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Target map bin or map value expression. | ||
* @param {AerospikeExp} map Source map expression. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} map Source map expression. | ||
* @param {AerospikeExp} bin Target map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -114,7 +114,10 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} value Increment value number expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {Object} policy Optional map write policy. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} value Increment value number expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* | ||
* | ||
* @return {AerospikeExp} (map expression) | ||
@@ -133,4 +136,4 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -146,5 +149,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -162,6 +166,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} keys List expression of keys to remove. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} keys List expression of keys to remove. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
* | ||
*/ | ||
@@ -180,6 +185,6 @@ removeByKeyList: (bin, keys, ctx = null) => [ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -198,6 +203,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -216,7 +221,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -236,5 +241,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -252,5 +257,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} values Values list expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} values Values list expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -270,6 +275,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -288,6 +293,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -307,10 +312,10 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
*/ | ||
removeByValueRelRankRange: (bin, count, rank, value, key, ctx = null) => [ | ||
removeByValueRelRankRange: (bin, count, rank, value, ctx = null) => [ | ||
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), | ||
@@ -327,5 +332,5 @@ ..._int(maps.RETURN_NONE), | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -343,5 +348,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -359,6 +364,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -377,5 +382,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -393,5 +398,5 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -409,6 +414,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (map expression) | ||
@@ -431,4 +436,4 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (integer expression) | ||
@@ -446,7 +451,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -468,7 +473,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} end End key expression. | ||
* @param {AerospikeExp} begin Begin key expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} begin Begin key expression. | ||
* @param {AerospikeExp} end End key expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -489,6 +494,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} keys Keys list expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} keys Keys list expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -508,7 +513,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -529,8 +534,8 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} key Key expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -552,6 +557,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -573,7 +578,8 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} begin Begin value expression. | ||
* @param {AerospikeExp} end End value expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -594,6 +600,6 @@ */ | ||
* | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} values Values list expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @return {AerospikeExp} (expression) | ||
@@ -613,7 +619,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -634,8 +640,8 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} value Value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -657,7 +663,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -677,6 +683,7 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -696,7 +703,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} idx Index integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -717,7 +724,7 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} valueType expression value type. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -737,6 +744,6 @@ */ | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -756,7 +763,8 @@ */ | ||
* | ||
* | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} ctx Optional context path for nested CDT. | ||
* @param {AerospikeExp} returnType Return type. | ||
* @param {AerospikeExp} rank Rank integer expression. | ||
* @param {AerospikeExp} count Count integer expression. | ||
* @param {AerospikeExp} bin Map bin or map value expression. | ||
* @return {AerospikeExp} (expression) | ||
@@ -763,0 +771,0 @@ */ |
@@ -903,2 +903,25 @@ // ***************************************************************************** | ||
/** | ||
* @summary Retrieves map items identified by keys list. | ||
* | ||
* @description This operation returns the data specified by | ||
* <code>returnType</code>. | ||
* | ||
* @param {string} bin - The name of the bin, which must contain a Map value. | ||
* @param {any} keys - The map keys. | ||
* @param {number} [returnType] - The {@link module:aerospike/maps.returnType|return type} | ||
* indicating what data of the selected item(s) to return. | ||
* @returns {Object} Operation that can be passed to the {@link Client#operate} command. | ||
* | ||
* @see Instead of passing <code>returnType</code>, you can also use | ||
* {@link module:aerospike/maps~MapOperation#andReturn|MapOperation#andReturn} to | ||
* select what data to return. | ||
*/ | ||
exports.getByKeyList = function (bin, keys, returnType) { | ||
const op = new MapOperation(opcodes.MAP_GET_BY_KEY_LIST, bin) | ||
op.keys = keys | ||
op.returnType = returnType | ||
return op | ||
} | ||
/** | ||
* @summary Retrieves one or more items identified by a range of keys from the | ||
@@ -1033,2 +1056,26 @@ * map. | ||
/** | ||
* @summary Retrieves map items identified by values from the | ||
* map. | ||
* | ||
* @description This operation returns the data specified by | ||
* <code>returnType</code>. | ||
* | ||
* @param {string} bin - The name of the bin, which must contain a Map value. | ||
* @param {any} values - The map values. | ||
* @param {number} [returnType] - The {@link module:aerospike/maps.returnType|return type} | ||
* indicating what data of the selected item(s) to return. | ||
* @returns {Object} Operation that can be passed to the {@link Client#operate} command. | ||
* | ||
* @see Instead of passing <code>returnType</code>, you can also use | ||
* {@link module:aerospike/maps~MapOperation#andReturn|MapOperation#andReturn} to | ||
* select what data to return. | ||
*/ | ||
exports.getByValueList = function (bin, values, returnType) { | ||
const op = new MapOperation(opcodes.MAP_GET_BY_VALUE_LIST, bin) | ||
op.values = values | ||
op.returnType = returnType | ||
return op | ||
} | ||
/** | ||
* @summary Retrieves one or more items identified by a range of values from | ||
@@ -1035,0 +1082,0 @@ * the map. |
{ | ||
"name": "aerospike", | ||
"version": "5.2.2", | ||
"version": "5.3.0", | ||
"description": "Aerospike Client Library", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"preinstall": "npm install @mapbox/node-pre-gyp", | ||
"install": "node ./scripts/prebuiltBinding.js; node-pre-gyp install --fallback-to-build", | ||
"install": "node ./scripts/prebuiltBinding.js; node-pre-gyp install --fallback-to-build;", | ||
"postinstall": "node scripts/postinstall.js", | ||
@@ -45,0 +45,0 @@ "test": "mocha", |
@@ -26,2 +26,3 @@ // ***************************************************************************** | ||
const lists = Aerospike.lists | ||
const Context = Aerospike.cdt.Context | ||
@@ -68,3 +69,2 @@ const helper = require('./test_helper') | ||
}) | ||
describe('list expressions', function () { | ||
@@ -80,2 +80,11 @@ describe('list size', function () { | ||
describe('list size with context', function () { | ||
it('matches the size of a list value within a nested context', async function () { | ||
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) | ||
const context = new Context().addListIndex(2) | ||
await testNoMatch(key, exp.eq(exp.lists.size(exp.binList('tags'), context), exp.int(5))) | ||
await testMatch(key, exp.eq(exp.lists.size(exp.binList('tags'), context), exp.int(4))) | ||
}) | ||
}) | ||
describe('getByValue', function () { | ||
@@ -90,2 +99,11 @@ it('matches the count of the matched list values', async function () { | ||
describe('getByValue with context', function () { | ||
it('matches the count of the matched list values', async function () { | ||
const key = await createRecord({ tags: ['blue', 'green', 'yellow', 'green', ['orange', 'pink', 'white', 'black', 'pink']] }) | ||
const context = new Context().addListIndex(4) | ||
await testNoMatch(key, exp.eq(exp.lists.getByValue(exp.binList('tags'), exp.str('pink'), lists.returnType.COUNT, context), exp.int(1))) | ||
await testMatch(key, exp.eq(exp.lists.getByValue(exp.binList('tags'), exp.str('pink'), lists.returnType.COUNT, context), exp.int(2))) | ||
}) | ||
}) | ||
describe('getByValueRange', function () { | ||
@@ -100,2 +118,11 @@ it('matches the count of the matched range of list values', async function () { | ||
describe('getByValueRange with context', function () { | ||
it('matches the count of the matched range of list values', async function () { | ||
const key = await createRecord({ values: [53, 16, 94, 38, 25, 88, 48, [1, 92, 94, 96]] }) | ||
const context = new Context().addListIndex(7) | ||
await testNoMatch(key, exp.eq(exp.lists.getByValueRange(exp.binList('values'), exp.int(90), exp.int(99), lists.returnType.COUNT, context), exp.int(1))) | ||
await testMatch(key, exp.eq(exp.lists.getByValueRange(exp.binList('values'), exp.int(90), exp.int(99), lists.returnType.COUNT, context), exp.int(3))) | ||
}) | ||
}) | ||
describe('getByValueList', function () { | ||
@@ -110,2 +137,11 @@ it('matches the count of the matched values', async function () { | ||
describe('getByValueList with context', function () { | ||
it('matches the count of the matched values', async function () { | ||
const key = await createRecord({ values: [53, 16, 94, 38, 25, 88, 88, 48, 16, [0, 1, 2, 73, 74, 73, 74]] }) | ||
const context = new Context().addListIndex(9) | ||
await testNoMatch(key, exp.eq(exp.lists.getByValueList(exp.binList('values'), exp.list([73, 74]), lists.returnType.COUNT, context), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.lists.getByValueList(exp.binList('values'), exp.list([73, 74]), lists.returnType.COUNT, context), exp.int(4))) | ||
}) | ||
}) | ||
describe('getByRelRankRangeToEnd', function () { | ||
@@ -120,2 +156,11 @@ it('selects list items nearest to value and greater by relative rank', async function () { | ||
describe('getByRelRankRangeToEnd with context', function () { | ||
it('selects list items nearest to value and greater by relative rank', async function () { | ||
const key = await createRecord({ values: [53, 16, [2, 12, 14, 17]] }) | ||
const context = new Context().addListIndex(2) | ||
await testNoMatch(key, exp.eq(exp.lists.getByRelRankRangeToEnd(exp.binList('values'), exp.int(12), exp.int(1), lists.returnType.VALUE, context), exp.list([16, 53]))) | ||
await testMatch(key, exp.eq(exp.lists.getByRelRankRangeToEnd(exp.binList('values'), exp.int(12), exp.int(1), lists.returnType.VALUE, context), exp.list([14, 17]))) | ||
}) | ||
}) | ||
describe('getByRelRankRange', function () { | ||
@@ -130,2 +175,11 @@ it('selects list items nearest to value and greater by relative rank with a count limit', async function () { | ||
describe('getByRelRankRange with context', function () { | ||
it('selects list items nearest to value and greater by relative rank with a count limit', async function () { | ||
const key = await createRecord({ values: [53, 16, 94, [30, 40, 45, 20]] }) | ||
const context = new Context().addListIndex(3) | ||
await testNoMatch(key, exp.eq(exp.lists.getByRelRankRange(exp.binList('values'), exp.int(30), exp.int(1), exp.int(3), lists.returnType.VALUE, context), exp.list([94]))) | ||
await testMatch(key, exp.eq(exp.lists.getByRelRankRange(exp.binList('values'), exp.int(30), exp.int(1), exp.int(3), lists.returnType.VALUE, context), exp.list([40, 45]))) | ||
}) | ||
}) | ||
describe('getByIndex', function () { | ||
@@ -140,2 +194,11 @@ it('selects item identified by index', async function () { | ||
describe('getByIndex with context', function () { | ||
it('selects item identified by index within nested context', async function () { | ||
const key = await createRecord({ values: ['Singapore', 'Hamburg', 'San Francisco', 'Tokyo', ['Firth', 'Hickman', 'Palmyra']] }) | ||
const context = new Context().addListIndex(4) | ||
await testNoMatch(key, exp.eq(exp.lists.getByIndex(exp.binList('values'), exp.int(2), exp.type.STR, lists.returnType.VALUE, context), exp.str('San Francisco'))) | ||
await testMatch(key, exp.eq(exp.lists.getByIndex(exp.binList('values'), exp.int(2), exp.type.STR, lists.returnType.VALUE, context), exp.str('Palmyra'))) | ||
}) | ||
}) | ||
describe('getByIndexRangeToEnd', function () { | ||
@@ -150,2 +213,11 @@ it('selects list items starting at specified index to the end of the list', async function () { | ||
describe('getByIndexRangeToEnd with context', function () { | ||
it('selects list items starting at specified index to the end of the list', async function () { | ||
const key = await createRecord({ values: ['Singapore', 'Hamburg', 'San Francisco', 'Tokyo', ['Firth', 'Hickman', 'Palmyra']] }) | ||
const context = new Context().addListIndex(4) | ||
await testNoMatch(key, exp.eq(exp.lists.getByIndexRangeToEnd(exp.binList('values'), exp.int(1), lists.returnType.VALUE, context), exp.list(['Hamburg', 'San Francisco', 'Tokyo']))) | ||
await testMatch(key, exp.eq(exp.lists.getByIndexRangeToEnd(exp.binList('values'), exp.int(1), lists.returnType.VALUE, context), exp.list(['Hickman', 'Palmyra']))) | ||
}) | ||
}) | ||
describe('getByIndexRange', function () { | ||
@@ -160,2 +232,11 @@ it('selects "count" list items starting at specified index', async function () { | ||
describe('getByIndexRange with context', function () { | ||
it('selects "count" list items starting at specified index', async function () { | ||
const key = await createRecord({ values: ['Singapore', 'Hamburg', 'San Francisco', 'Tokyo', ['Firth', 'Hickman', 'Palmyra']] }) | ||
const context = new Context().addListIndex(4) | ||
await testNoMatch(key, exp.eq(exp.lists.getByIndexRange(exp.binList('values'), exp.int(0), exp.int(2), lists.returnType.VALUE, context), exp.list(['Singapore', 'Hamburg']))) | ||
await testMatch(key, exp.eq(exp.lists.getByIndexRange(exp.binList('values'), exp.int(0), exp.int(2), lists.returnType.VALUE, context), exp.list(['Firth', 'Hickman']))) | ||
}) | ||
}) | ||
describe('getByRank', function () { | ||
@@ -170,2 +251,11 @@ it('selects list item identified by rank', async function () { | ||
describe('getByRank with context', function () { | ||
it('selects list item identified by rank', async function () { | ||
const key = await createRecord({ values: [83, [0, 4, 2, 8], 40] }) | ||
const context = new Context().addListIndex(1) | ||
await testNoMatch(key, exp.eq(exp.lists.getByRank(exp.binList('values'), exp.int(2), exp.type.INT, lists.returnType.VALUE, context), exp.int(40))) | ||
await testMatch(key, exp.eq(exp.lists.getByRank(exp.binList('values'), exp.int(2), exp.type.INT, lists.returnType.VALUE, context), exp.int(4))) | ||
}) | ||
}) | ||
describe('getByRankRangeToEnd', function () { | ||
@@ -180,2 +270,11 @@ it('selects list items starting at specified rank to the last ranked item', async function () { | ||
describe('getByRankRangeToEnd with context', function () { | ||
it('selects list items starting at specified rank to the last ranked item', async function () { | ||
const key = await createRecord({ values: [83, [0, 4, 2, 8]] }) | ||
const context = new Context().addListIndex(1) | ||
await testNoMatch(key, exp.eq(exp.lists.getByRankRangeToEnd(exp.binList('values'), exp.int(1), lists.returnType.VALUE, context), exp.list([0, 2, 4, 8]))) | ||
await testMatch(key, exp.eq(exp.lists.getByRankRangeToEnd(exp.binList('values'), exp.int(1), lists.returnType.VALUE, context), exp.list([2, 4, 8]))) | ||
}) | ||
}) | ||
describe('getByRankRange', function () { | ||
@@ -190,4 +289,13 @@ it('selects "count" list items starting at specified rank', async function () { | ||
describe('getByRankRange with context', function () { | ||
it('selects "count" list items starting at specified rank', async function () { | ||
const key = await createRecord({ values: [83, [0, 4, 2, 8]] }) | ||
const context = new Context().addListIndex(1) | ||
await testNoMatch(key, exp.eq(exp.lists.getByRankRange(exp.binList('values'), exp.int(1), exp.int(4), lists.returnType.VALUE, context), exp.list([83, [0, 4, 2, 8]]))) | ||
await testMatch(key, exp.eq(exp.lists.getByRankRange(exp.binList('values'), exp.int(1), exp.int(4), lists.returnType.VALUE, context), exp.list([2, 4, 8]))) | ||
}) | ||
}) | ||
describe('list bin append expression', function () { | ||
it('evaluates exp list append to true if exp op read temp bin equals to appended list', async function () { | ||
it('appends integer value to list', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5], intVal: 6 }) | ||
@@ -205,5 +313,21 @@ const ops = [ | ||
}) | ||
it('appends integer value to a list within a nested context', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5, [4]], intVal: 6 }) | ||
const context = new Context().addListIndex(4) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.lists.append(exp.binList('list'), exp.binInt('intVal'), null, context), | ||
0), | ||
op.read('list') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
// console.log(result) | ||
expect(result.bins.list).to.eql([2, 3, 4, 5, [4]]) | ||
expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 6]]) | ||
}) | ||
}) | ||
describe('list bin appendItems expression', function () { | ||
it('evaluates exp list appendItems to true if exp op read temp bin equals to appended list', async function () { | ||
it('appends list to itself', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5] }) | ||
@@ -221,6 +345,21 @@ const ops = [ | ||
}) | ||
it('appends list to a list within a nested context', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5, [80, 90, 100]] }) | ||
const context = new Context().addListIndex(4) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.lists.appendItems(exp.binList('list'), exp.binList('list'), null, context), | ||
0), | ||
op.read('list') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
// console.log(result) | ||
expect(result.bins.list).to.eql([2, 3, 4, 5, [80, 90, 100]]) | ||
expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [80, 90, 100, 2, 3, 4, 5, [80, 90, 100]]]) | ||
}) | ||
}) | ||
}) | ||
describe('list bin insert expression', function () { | ||
it('evaluates exp list insert to true if exp op read temp bin equals to inserted list', async function () { | ||
it('inserts value at specified index', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5], intVal: 6 }) | ||
@@ -238,5 +377,20 @@ const ops = [ | ||
}) | ||
it('inserts value at specified index within a nested context', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5, [4, 1, 9]], intVal: 7 }) | ||
const context = new Context().addListIndex(4) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.lists.insert(exp.binList('list'), exp.binInt('intVal'), exp.int(2), null, context), | ||
0), | ||
op.read('list') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
// console.log(result) | ||
expect(result.bins.list).to.eql([2, 3, 4, 5, [4, 1, 9]]) | ||
expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 1, 7, 9]]) | ||
}) | ||
}) | ||
describe('list bin insertItems expression', function () { | ||
it('evaluates exp list appendItems to true if exp op read temp bin equals to appended list', async function () { | ||
it('inserts values at specified index', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5] }) | ||
@@ -254,5 +408,21 @@ const ops = [ | ||
}) | ||
it('inserts values at specified index within a nested context', async function () { | ||
const key = await createRecord({ list: [2, 3, [9, 9]] }) | ||
const context = new Context().addListIndex(2) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.lists.insertItems(exp.binList('list'), exp.binList('list'), exp.int(1), null, context), | ||
0), | ||
op.read('list') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
// console.log(result) | ||
expect(result.bins.list).to.eql([2, 3, [9, 9]]) | ||
expect(result.bins.ExpVar).to.eql([2, 3, [9, 2, 3, [9, 9], 9]]) | ||
}) | ||
}) | ||
describe('list bin sort expression', function () { | ||
it('evaluates exp list sort to true if exp op read temp bin equals to sorted list', async function () { | ||
it('sorts specified list', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5] }) | ||
@@ -273,3 +443,19 @@ const ops = [ | ||
}) | ||
it('sorts specified nested list', async function () { | ||
const key = await createRecord({ list: [2, 3, 4, 5, [9, 100]] }) | ||
const context = new Context().addListIndex(4) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.lists.sort(exp.binList('list'), 1, context), | ||
0), | ||
op.read('list') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result.bins.ExpVar) | ||
// console.log(result) | ||
expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [100, 9]]) | ||
expect(result.bins.list).to.eql([2, 3, 4, 5, [9, 100]]) | ||
}) | ||
}) | ||
}) |
@@ -26,3 +26,3 @@ // ***************************************************************************** | ||
const op = Aerospike.operations | ||
const Context = Aerospike.cdt.Context | ||
const helper = require('./test_helper') | ||
@@ -64,2 +64,11 @@ const keygen = helper.keygen | ||
const orderMap = (bin, order, ctx) => { | ||
const policy = new Aerospike.MapPolicy({ order }) | ||
const setMapPolicy = maps.setPolicy(bin, policy) | ||
if (ctx) setMapPolicy.withContext(ctx) | ||
return client.operate(setMapPolicy) | ||
} | ||
const orderByKey = (bin, ctx) => orderMap(bin, maps.order.KEY_ORDERED, ctx) | ||
it('builds up a filter expression value', function () { | ||
@@ -71,46 +80,10 @@ const filter = exp.eq(exp.binInt('intVal'), exp.int(42)) | ||
describe('map expressions', function () { | ||
describe('map size', function () { | ||
it('returns the map size', async function () { | ||
const key = await createRecord({ map: { john: 42, malcom: 73, susan: 27 } }) | ||
await testNoMatch(key, exp.eq(exp.maps.size(exp.binMap('map')), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.size(exp.binMap('map')), exp.int(3))) | ||
}) | ||
}) | ||
describe('map bin putItems expression', function () { | ||
it('evaluates exp_write op to true if temp bin equals to combined maps', async function () { | ||
const key = await createRecord({ map: { c: 1, b: 2, a: 3 }, map2: { f: 1, e: 2, d: 3 } }) | ||
const ops = [ | ||
exp.operations.write('map', | ||
exp.maps.putItems(exp.binMap('map'), exp.binMap('map2')), | ||
0), | ||
op.read('map') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
// console.log(result) | ||
expect(result.bins.map).to.eql({ a: 3, b: 2, c: 1, d: 3, e: 2, f: 1 }) | ||
}) | ||
}) | ||
describe('getByValue', function () { | ||
it('matches the count of the matched map values', async function () { | ||
describe('clear', function () { | ||
it('removes all items in a map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('green'), maps.returnType.COUNT), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('green'), maps.returnType.COUNT), exp.int(1))) | ||
}) | ||
}) | ||
describe('getByValueRange', function () { | ||
it('matches the count of the matched range of map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('yellow'), exp.str('blue'), maps.returnType.COUNT), exp.int(3))) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByValueRange( | ||
exp.binMap('tags'), | ||
exp.str('yellow'), | ||
exp.str('blue'), | ||
maps.returnType.COUNT), | ||
exp.operations.write('tags', | ||
exp.maps.clear( | ||
exp.binMap('tags')), | ||
0), | ||
@@ -120,18 +93,15 @@ op.read('tags') | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('yellow'), exp.str('blue'), maps.returnType.COUNT), exp.int(2))) | ||
expect(result.bins).to.eql({ tags: {} }) | ||
}) | ||
}) | ||
describe('getByValueList', function () { | ||
it('matches the count of the matched values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
it('selects item identified by index inside nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByValueList( | ||
exp.operations.write('tags', | ||
exp.maps.clear( | ||
exp.binMap('tags'), | ||
exp.list(['yellow', 'blue']), | ||
maps.returnType.KEY), | ||
context), | ||
0), | ||
@@ -141,11 +111,9 @@ op.read('tags') | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['green', 'yellow']), maps.returnType.COUNT), exp.int(3))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['green', 'yellow']), maps.returnType.COUNT), exp.int(0))) | ||
expect(result.bins).to.eql({ tags: { a: 'blue', nested: {} } }) | ||
}) | ||
}) | ||
describe('getByValueRelRankRangeToEnd', function () { | ||
it('selects map items nearest to value and greater by relative rank', async function () { | ||
describe('getByIndex', function () { | ||
it('selects item identified by index', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
@@ -155,6 +123,6 @@ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByValueRelRankRangeToEnd( | ||
exp.maps.getByIndex( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
exp.int(2), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
@@ -164,74 +132,25 @@ 0), | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
await client.operate(key, ops, {}) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(1))) | ||
}) | ||
}) | ||
describe('getByRelRankRange', function () { | ||
it('selects map items nearest to value and greater by relative rank with a count limit', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByValueRelRankRange( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.KEY), | ||
0), | ||
op.read('tags') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.maps.getByIndex( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.maps.getByIndex( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
exp.int(1))) | ||
}) | ||
}) | ||
describe('getByIndex', function () { | ||
it('selects item identified by index', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByIndex( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
0), | ||
op.read('tags') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
it('selects item identified by index inside nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
orderByKey('tags') | ||
orderByKey('tags', context) | ||
await testNoMatch(key, exp.eq( | ||
@@ -241,4 +160,5 @@ exp.maps.getByIndex( | ||
exp.int(2), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
exp.type.AUTO, | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
@@ -248,5 +168,6 @@ await testMatch(key, exp.eq( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
exp.int(3), | ||
exp.type.AUTO, | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(1))) | ||
@@ -256,9 +177,10 @@ }) | ||
describe('getByIndexRangeToEnd', function () { | ||
it('selects map items starting at specified index to the end of the map', async function () { | ||
describe('getByIndexRange', function () { | ||
it('selects "count" map items starting at specified index', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.maps.getByIndexRange( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
@@ -268,4 +190,5 @@ maps.returnType.COUNT), | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.maps.getByIndexRange( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
@@ -275,12 +198,34 @@ maps.returnType.COUNT), | ||
}) | ||
it('selects "count" map items starting at specified nested index', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
orderByKey('tags') | ||
orderByKey('tags', context) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByIndexRange( | ||
exp.binMap('tags'), | ||
exp.int(6), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByIndexRange( | ||
exp.binMap('tags'), | ||
exp.int(6), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(4))) | ||
}) | ||
}) | ||
describe('getByIndexRange', function () { | ||
it('selects "count" map items starting at specified index', async function () { | ||
describe('getByIndexRangeToEnd', function () { | ||
it('selects map items starting at specified index to the end of the map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByIndexRange( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
@@ -290,5 +235,4 @@ maps.returnType.COUNT), | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByIndexRange( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
@@ -298,4 +242,85 @@ maps.returnType.COUNT), | ||
}) | ||
it('selects map items starting at specified index to the end of the map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
orderByKey('tags') | ||
orderByKey('tags', context) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByIndexRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(4))) | ||
}) | ||
}) | ||
describe('getByKey', function () { | ||
it('matches the count of the matched map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByKey(exp.binMap('tags'), exp.str('a'), exp.type.AUTO, maps.returnType.COUNT), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByKey(exp.binMap('tags'), exp.str('a'), exp.type.AUTO, maps.returnType.COUNT), exp.int(1))) | ||
}) | ||
it('matches the count of the matched map values of a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByKey(exp.binMap('tags'), exp.str('d'), exp.type.AUTO, maps.returnType.COUNT, context), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByKey(exp.binMap('tags'), exp.str('d'), exp.type.AUTO, maps.returnType.COUNT, context), exp.int(1))) | ||
}) | ||
}) | ||
describe('getByKeyRange', function () { | ||
it('matches the count of the matched map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRange(exp.binMap('tags'), exp.str('c'), exp.str('a'), maps.returnType.COUNT), exp.int(3))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRange(exp.binMap('tags'), exp.str('c'), exp.str('a'), maps.returnType.COUNT), exp.int(2))) | ||
}) | ||
it('matches the count of the matched map values of a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRange(exp.binMap('tags'), exp.str('g'), exp.str('d'), maps.returnType.COUNT, context), exp.int(4))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRange(exp.binMap('tags'), exp.str('g'), exp.str('d'), maps.returnType.COUNT, context), exp.int(3))) | ||
}) | ||
}) | ||
describe('getByKeyRelIndexRange', function () { | ||
it('matches the count of the matched map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', d: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRange(exp.binMap('tags'), exp.int(3), exp.int(0), exp.str('b'), maps.returnType.COUNT), exp.int(1))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRange(exp.binMap('tags'), exp.int(3), exp.int(0), exp.str('b'), maps.returnType.COUNT), exp.int(2))) | ||
}) | ||
it('matches the count of the matched map values of a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', g: 'white', h: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRange(exp.binMap('tags'), exp.int(3), exp.int(0), exp.str('g'), maps.returnType.COUNT, context), exp.int(1))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRange(exp.binMap('tags'), exp.int(3), exp.int(0), exp.str('g'), maps.returnType.COUNT, context), exp.int(2))) | ||
}) | ||
}) | ||
/* | ||
describe('getByKeyRelIndexRangeToEnd', function () { | ||
it('matches the count of the matched map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', d: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('b'), maps.returnType.COUNT), exp.int(1))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('b'), maps.returnType.COUNT), exp.int(2))) | ||
}) | ||
it('matches the count of the matched map values of a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', g: 'white', h: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(3))) | ||
}) | ||
}) | ||
*/ | ||
describe('getByRank', function () { | ||
@@ -315,4 +340,3 @@ it('selects map item identified by rank', async function () { | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
console.log(result) | ||
await client.operate(key, ops, {}) | ||
@@ -334,20 +358,34 @@ await testNoMatch(key, exp.eq( | ||
}) | ||
}) | ||
describe('getByRankRangeToEnd', function () { | ||
it('selects map items starting at specified rank to the last ranked item', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
it('selects map item identified by rank within a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', d: 5, c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
const ops = [ | ||
exp.operations.read(tempBin, | ||
exp.maps.getByRank( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.type.INT, | ||
maps.returnType.COUNT), | ||
0), | ||
op.read('tags') | ||
] | ||
await client.operate(key, ops, {}) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.maps.getByRank( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT), | ||
exp.type.INT, | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.maps.getByRank( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT), | ||
exp.int(3))) | ||
exp.type.INT, | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(1))) | ||
}) | ||
@@ -375,4 +413,255 @@ }) | ||
}) | ||
it('selects "count" map items starting at specified rank in nested context', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByRankRange( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByRankRange( | ||
exp.binMap('tags'), | ||
exp.int(5), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(4))) | ||
}) | ||
}) | ||
describe('getByRankRangeToEnd', function () { | ||
it('selects map items starting at specified rank to the last ranked item', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT), | ||
exp.int(3))) | ||
}) | ||
it('selects map items starting at specified rank to the last ranked item in a nested context', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(4))) | ||
}) | ||
}) | ||
}) | ||
describe('getByValue', function () { | ||
it('matches the count of the matched map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('green'), maps.returnType.COUNT), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('green'), maps.returnType.COUNT), exp.int(1))) | ||
}) | ||
it('matches the count of the matched map values of a nested map', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('orange'), maps.returnType.COUNT, context), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.getByValue(exp.binMap('tags'), exp.str('orange'), maps.returnType.COUNT, context), exp.int(1))) | ||
}) | ||
}) | ||
/* | ||
describe('getByValueList', function () { | ||
it('matches the count of the matched values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('green'), exp.str('yellow')]), maps.returnType.COUNT), exp.int(3))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('green'), exp.str('yellow')]), maps.returnType.COUNT), exp.int(2))) | ||
}) | ||
it('matches the count of the matched values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('orange'), exp.str('white')]), maps.returnType.COUNT, context), exp.int(3))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('orange'), exp.str('white')]), maps.returnType.COUNT, context), exp.int(2))) | ||
}) | ||
}) | ||
*/ | ||
describe('getByValueRange', function () { | ||
it('matches the count of the matched range of map values', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('yellow'), exp.str('blue'), maps.returnType.COUNT), exp.int(3))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('yellow'), exp.str('blue'), maps.returnType.COUNT), exp.int(2))) | ||
}) | ||
it('matches the count of the matched range of map values in a nested context', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('white'), exp.str('black'), maps.returnType.COUNT, context), exp.int(4))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('white'), exp.str('black'), maps.returnType.COUNT, context), exp.int(3))) | ||
}) | ||
}) | ||
describe('getByValueRelRankRange', function () { | ||
it('selects map items nearest to value and greater by relative rank with a count limit', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(1))) | ||
}) | ||
it('selects map items nearest to value and greater by relative rank with a count limit in a nested context', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('pink'), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq( | ||
exp.maps.getByValueRelRankRange( | ||
exp.binMap('tags'), | ||
exp.int(2), | ||
exp.int(0), | ||
exp.str('pink'), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(2))) | ||
}) | ||
}) | ||
describe('getByValueRelRankRangeToEnd', function () { | ||
it('selects map items nearest to value and greater by relative rank', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('yellow'), | ||
maps.returnType.COUNT), | ||
exp.int(1))) | ||
}) | ||
it('selects map items nearest to value and greater by relative rank in a nested context', async function () { | ||
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('orange'), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(0))) | ||
await testMatch(key, exp.eq(exp.maps.getByValueRelRankRangeToEnd( | ||
exp.binMap('tags'), | ||
exp.int(0), | ||
exp.str('orange'), | ||
maps.returnType.COUNT, | ||
context), | ||
exp.int(3))) | ||
}) | ||
}) | ||
describe('putItems', function () { | ||
it('writes map values to a specified map', async function () { | ||
const key = await createRecord({ map: { c: 1, b: 2, a: 3 }, map2: { f: 1, e: 2, d: 3 } }) | ||
const ops = [ | ||
exp.operations.write('map', | ||
exp.maps.putItems(exp.binMap('map'), exp.binMap('map2')), | ||
0), | ||
op.read('map') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
expect(result.bins.map).to.eql({ a: 3, b: 2, c: 1, d: 3, e: 2, f: 1 }) | ||
}) | ||
it('writes map values from exp.map expression to specified map', async function () { | ||
const key = await createRecord({ map: { c: 1, b: 2, a: 3 } }) | ||
const ops = [ | ||
exp.operations.write('map', | ||
exp.maps.putItems(exp.binMap('map'), exp.map({ f: 1, e: 2, d: 3 })), | ||
0), | ||
op.read('map') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
expect(result.bins.map).to.eql({ a: 3, b: 2, c: 1, d: 3, e: 2, f: 1 }) | ||
}) | ||
it('writes map values originating from nested map to a specified map', async function () { | ||
const key = await createRecord({ map: { c: 1, b: 2, a: 3, nested: { g: 4 } }, map2: { f: 1, e: 2, d: 3 } }) | ||
const context = new Context().addMapKey('nested') | ||
const ops = [ | ||
exp.operations.write('map', | ||
exp.maps.putItems(exp.binMap('map'), exp.binMap('map2'), null, context), | ||
0), | ||
op.read('map') | ||
] | ||
const result = await client.operate(key, ops, {}) | ||
expect(result.bins.map.nested).to.eql({ d: 3, e: 2, f: 1, g: 4 }) | ||
}) | ||
}) | ||
describe('size', function () { | ||
it('returns the map size', async function () { | ||
const key = await createRecord({ map: { john: 42, malcom: 73, susan: 27 } }) | ||
await testNoMatch(key, exp.eq(exp.maps.size(exp.binMap('map')), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.size(exp.binMap('map')), exp.int(3))) | ||
}) | ||
it('returns the map size from a nested map', async function () { | ||
const key = await createRecord({ map: { john: 42, malcom: 73, susan: 27, nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) | ||
const context = new Context().addMapKey('nested') | ||
await testNoMatch(key, exp.eq(exp.maps.size(exp.binMap('map'), context), exp.int(2))) | ||
await testMatch(key, exp.eq(exp.maps.size(exp.binMap('map'), context), exp.int(4))) | ||
}) | ||
}) | ||
}) |
@@ -1106,2 +1106,29 @@ // ***************************************************************************** | ||
context('returnType=EXISTS', function () { | ||
it('fetches all items with the specified values and returns the indexes', function () { | ||
return initState() | ||
.then(createRecord({ list: [1, 2, 3, 1, 2, 3] })) | ||
.then(operate(lists.getByValueList('list', [1, 3, 5]).andReturn(lists.returnType.EXISTS))) | ||
.then(assertResultEql({ list: true })) | ||
.then(cleanup) | ||
}) | ||
context('with nested list context', function () { | ||
helper.skipUnlessVersion('>= 4.6.0', this) | ||
it('fetches all items with the specified values and returns the indexes', function () { | ||
return initState() | ||
.then(createRecord({ list: [['a', 'b', 'c'], [1, 2, 3, 1, 2, 3]] })) | ||
.then(operate( | ||
lists | ||
.getByValueList('list', [7, 5, 4]) | ||
.withContext(ctx => ctx.addListIndex(1)) | ||
.andReturn(lists.returnType.EXISTS) | ||
)) | ||
.then(assertResultEql({ list: false })) | ||
.then(cleanup) | ||
}) | ||
}) | ||
}) | ||
context('invert results', function () { | ||
@@ -1108,0 +1135,0 @@ it('fetches all items except with the specified values', function () { |
104
test/maps.js
@@ -947,2 +947,45 @@ // ***************************************************************************** | ||
describe('maps.getByKeyList', function () { | ||
it('fetches a map entry identified by keys', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByKeyList('map', ['b', 'c'], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: ['b', 2, 'c', 3] })) | ||
.then(cleanup()) | ||
}) | ||
it('does not fail if the key does not exist', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByKeyList('map', ['z'], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: [] })) | ||
.then(cleanup()) | ||
}) | ||
it('does not fail if only some keys exist', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByKeyList('map', ['a', 'z'], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: ['a', 1] })) | ||
.then(cleanup()) | ||
}) | ||
context('with nested map context', function () { | ||
helper.skipUnlessVersion('>= 4.6.0', this) | ||
it('fetches a map entries identified by keys', function () { | ||
return initState() | ||
.then(createRecord({ list: [{ a: 1, b: 2, c: 3 }, { b: 3 }] })) | ||
.then(operate( | ||
maps | ||
.getByKeyList('list', ['a', 'b']) | ||
.withContext(ctx => ctx.addListIndex(0)) | ||
.andReturn(maps.returnType.KEY_VALUE) | ||
)) | ||
.then(assertResultEql({ list: ['a', 1, 'b', 2] })) | ||
.then(cleanup()) | ||
}) | ||
}) | ||
}) | ||
describe('maps.getByKeyRange', function () { | ||
@@ -1067,2 +1110,45 @@ it('fetches map entries identified by key range', function () { | ||
describe('maps.getByValueList', function () { | ||
it('fetches a map keys and values identified by values', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByValueList('map', [2, 3], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: ['b', 2, 'c', 3] })) | ||
.then(cleanup()) | ||
}) | ||
it('does not fail if the value does not exist', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByValueList('map', [4], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: [] })) | ||
.then(cleanup()) | ||
}) | ||
it('does not fail if only some values exist', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(operate(maps.getByValueList('map', [1, 4], maps.returnType.KEY_VALUE))) | ||
.then(assertResultEql({ map: ['a', 1] })) | ||
.then(cleanup()) | ||
}) | ||
context('with nested map context', function () { | ||
helper.skipUnlessVersion('>= 4.6.0', this) | ||
it('fetches a map keys and values identified by values', function () { | ||
return initState() | ||
.then(createRecord({ map: { nested: { a: 1, b: 2, c: 3 } } })) | ||
.then(operate( | ||
maps | ||
.getByValueList('map', [1, 2]) | ||
.withContext(ctx => ctx.addMapKey('nested')) | ||
.andReturn(maps.returnType.KEY_VALUE) | ||
)) | ||
.then(assertResultEql({ map: ['a', 1, 'b', 2] })) | ||
.then(cleanup()) | ||
}) | ||
}) | ||
}) | ||
describe('maps.getByValueRange', function () { | ||
@@ -1420,3 +1506,21 @@ it('fetches map entries identified by value range', function () { | ||
}) | ||
it('returns true or false for a single key read', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(orderByKey('map')) | ||
.then(operate(maps.getByKeyList('map', ['a', 'b', 'd'], maps.returnType.EXISTS))) | ||
.then(assertResultEql({ map: true })) | ||
.then(cleanup()) | ||
}) | ||
it('returns true if any values exisst', function () { | ||
return initState() | ||
.then(createRecord({ map: { a: 1, b: 2, c: 3 } })) | ||
.then(orderByKey('map')) | ||
.then(operate(maps.getByValueList('map', [1, 2, 4], maps.returnType.EXISTS))) | ||
.then(assertResultEql({ map: true })) | ||
.then(cleanup()) | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
285727460
38516