Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aerospike

Package Overview
Dependencies
Maintainers
5
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aerospike - npm Package Compare versions

Comparing version 5.7.0 to 5.8.0

lib/bin.js

8

lib/aerospike.js

@@ -267,2 +267,10 @@ // *****************************************************************************

/**
* In the Aerospike database, each record (similar to a row in a relational database) stores
* data using one or more bins (like columns in a relational database).
*
* @summary {@link Bin} class
*/
exports.Bin = require('./bin')
// ========================================================================

@@ -269,0 +277,0 @@ // Enumerations

9

lib/error.js

@@ -22,8 +22,10 @@ // *****************************************************************************

/**
* Error raised by the client when execution of a database command fails. This
*
*
* @extends Error
* @class AerospikeError
* @classdesc Error raised by the client when execution of a database command fails. This
* may be either due to an error status code returned by the server, or caused
* by an error condition that occured on the client side.
*
* @extends Error
*
* @example <caption>Expected output: "Error: 127.0.0.1:3000 Record does not exist in database. May be returned by read, or write with policy Aerospike.policy.exists.UPDATE [2]"</caption>

@@ -53,3 +55,2 @@ *

class AerospikeError extends Error {
/** @private */
constructor (message, command) {

@@ -56,0 +57,0 @@ super(message)

@@ -453,5 +453,5 @@ // *****************************************************************************

*/
removeByValue: (bin, value, ctx = null) => [
removeByValue: (bin, value, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_ALL_BY_VALUE, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...value,

@@ -469,5 +469,5 @@ ...bin

*/
removeByValueList: (bin, values, ctx = null) => [
removeByValueList: (bin, values, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_LIST, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...values,

@@ -488,5 +488,5 @@ ...bin

*/
removeByValueRange: (bin, end, begin, ctx = null) => [
removeByValueRange: (bin, end, begin, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_INTERVAL, 3, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...begin,

@@ -506,5 +506,5 @@ ...end,

*/
removeByRelRankRangeToEnd: (bin, rank, value, ctx = null) => [
removeByRelRankRangeToEnd: (bin, rank, value, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...value,

@@ -526,5 +526,5 @@ ...rank,

*/
removeByRelRankRange: (bin, count, rank, value, ctx = null) => [
removeByRelRankRange: (bin, count, rank, value, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...value,

@@ -544,5 +544,5 @@ ...rank,

*/
removeByIndex: (bin, idx, ctx = null) => [
removeByIndex: (bin, idx, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...idx,

@@ -560,5 +560,5 @@ ...bin

*/
removeByIndexRangeToEnd: (bin, idx, ctx = null) => [
removeByIndexRangeToEnd: (bin, idx, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX_RANGE, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...idx,

@@ -577,5 +577,5 @@ ...bin

*/
removeByIndexRange: (bin, count, idx, ctx = null) => [
removeByIndexRange: (bin, count, idx, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX_RANGE, 3, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...idx,

@@ -594,5 +594,5 @@ ...count,

*/
removeByRank: (bin, rank, ctx = null) => [
removeByRank: (bin, rank, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...rank,

@@ -610,5 +610,5 @@ ...bin

*/
removeByRankRangeToEnd: (bin, rank, ctx = null) => [
removeByRankRangeToEnd: (bin, rank, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK_RANGE, 2, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...rank,

@@ -627,5 +627,5 @@ ...bin

*/
removeByRankRange: (bin, count, rank, ctx = null) => [
removeByRankRange: (bin, count, rank, ctx = null, returnType = lists.returnType.NONE) => [
..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK_RANGE, 3, 0),
..._int(lists.RETURN_NONE),
..._int(lists.returnType.NONE),
...rank,

@@ -632,0 +632,0 @@ ...count,

@@ -148,8 +148,9 @@ const as = require('bindings')('aerospike.node')

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByKey: (bin, key, ctx = null) => [
removeByKey: (bin, key, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...key,

@@ -165,8 +166,9 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*
*/
removeByKeyList: (bin, keys, ctx = null) => [
removeByKeyList: (bin, keys, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_LIST, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...keys,

@@ -185,7 +187,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByKeyRange: (bin, end, begin, ctx = null) => [
removeByKeyRange: (bin, end, begin, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_INTERVAL, 3, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...begin,

@@ -203,7 +206,8 @@ ...end,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByKeyRelIndexRangeToEnd: (bin, idx, key, ctx = null) => [
removeByKeyRelIndexRangeToEnd: (bin, idx, key, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_REL_INDEX_RANGE, 3, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...key,

@@ -222,7 +226,8 @@ ...idx,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByKeyRelIndexRange: (bin, count, idx, key, ctx = null) => [
removeByKeyRelIndexRange: (bin, count, idx, key, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_REL_INDEX_RANGE, 4, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...key,

@@ -240,7 +245,8 @@ ...idx,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByValue: (bin, value, ctx = null) => [
removeByValue: (bin, value, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_ALL_BY_VALUE, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...value,

@@ -256,7 +262,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByValueList: (bin, values, ctx = null) => [
removeByValueList: (bin, values, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_LIST, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...values,

@@ -275,7 +282,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByValueRange: (bin, end, begin, ctx = null) => [
removeByValueRange: (bin, end, begin, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_INTERVAL, 3, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...begin,

@@ -293,7 +301,8 @@ ...end,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByValueRelRankRangeToEnd: (bin, rank, value, ctx = null) => [
removeByValueRelRankRangeToEnd: (bin, rank, value, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...value,

@@ -313,7 +322,8 @@ ...rank,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByValueRelRankRange: (bin, count, rank, value, ctx = null) => [
removeByValueRelRankRange: (bin, count, rank, value, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...value,

@@ -331,7 +341,8 @@ ...rank,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByIndex: (bin, idx, ctx = null) => [
removeByIndex: (bin, idx, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...idx,

@@ -347,7 +358,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByIndexRangeToEnd: (bin, idx, ctx = null) => [
removeByIndexRangeToEnd: (bin, idx, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX_RANGE, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...idx,

@@ -364,7 +376,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByIndexRange: (bin, count, idx, ctx = null) => [
..._mapModify(ctx, null, maps.opcodes.PUT, 3, 0),
..._int(maps.RETURN_NONE),
removeByIndexRange: (bin, count, idx, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX_RANGE, 3, 0),
..._int(returnType),
...idx,

@@ -381,7 +394,8 @@ ...count,

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByRank: (bin, rank, ctx = null) => [
removeByRank: (bin, rank, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...rank,

@@ -397,7 +411,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByRankRangeToEnd: (bin, rank, ctx = null) => [
removeByRankRangeToEnd: (bin, rank, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK_RANGE, 2, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...rank,

@@ -414,7 +429,8 @@ ...bin

* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED.
* @return {AerospikeExp} (map expression)
*/
removeByRankRange: (bin, count, rank, ctx = null) => [
removeByRankRange: (bin, count, rank, ctx = null, returnType = maps.returnType.NONE) => [
..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK_RANGE, 3, 0),
..._int(maps.RETURN_NONE),
..._int(returnType),
...rank,

@@ -495,3 +511,3 @@ ...count,

..._mapRead(exp.type.AUTO, returnType, true),
..._mapStart(ctx, maps.opcodes.GET_BY_KEY_INTERVAL, 2),
..._mapStart(ctx, maps.opcodes.GET_BY_KEY_LIST, 2),
..._int(returnType),

@@ -515,3 +531,3 @@ ...keys,

..._mapRead(exp.type.AUTO, returnType, true),
..._mapStart(ctx, maps.opcodes.GET_BY_KEY_INTERVAL, 3),
..._mapStart(ctx, maps.opcodes.GET_BY_KEY_REL_INDEX_RANGE, 3),
..._int(returnType),

@@ -598,3 +614,3 @@ ...key,

..._mapRead(exp.type.AUTO, returnType, true),
..._mapStart(ctx, maps.opcodes.GET_BY_VALUE_INTERVAL, 2),
..._mapStart(ctx, maps.opcodes.GET_BY_VALUE_LIST, 2),
..._int(returnType),

@@ -601,0 +617,0 @@ ...values,

@@ -211,2 +211,18 @@ // *****************************************************************************

/**
* Create 'inf' value.
*
* @function
* @return {AerospikeExp}
*/
exports.inf = () => [{ op: exp.ops.AS_VAL, inf: null }]
/**
* Create 'wildcard' value.
*
* @function
* @return {AerospikeExp}
*/
exports.wildcard = () => [{ op: exp.ops.AS_VAL, wildcard: null }]
const _val = _valueExp(exp.ops.AS_VAL, 'value')

@@ -213,0 +229,0 @@

{
"name": "aerospike",
"version": "5.7.0",
"version": "5.8.0",
"description": "Aerospike Client Library",

@@ -42,3 +42,4 @@ "keywords": [

"preinstall": "npm install @mapbox/node-pre-gyp",
"install": "node scripts/prebuiltBinding.js; node-pre-gyp install --fallback-to-build",
"install": "npm-run-all removeExtraBinaries build",
"build": "node-pre-gyp install --fallback-to-build",
"test": "mocha",

@@ -54,3 +55,4 @@ "test-noserver": "GLOBAL_CLIENT=false mocha -g '#noserver'",

"valgrind": "valgrind node ./node_modules/mocha/bin/_mocha -R dot -g '#slow' -i",
"prepare": "husky install"
"prepare": "husky install",
"removeExtraBinaries": "node ./scripts/prebuiltBinding.js"
},

@@ -74,2 +76,3 @@ "dependencies": {

"mocha-clean": "^1.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",

@@ -76,0 +79,0 @@ "p-throttle": "^3.1.0",

@@ -14,3 +14,3 @@ # Aerospike Node.js Client [![travis][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]

The client is compatible with Node.js 20 (LTS), 19, 18 (LTS), 16 (LTS).
The client is compatible with Node.js 20 (Upcoming LTS) and 18 (LTS).
It supports the following operating systems:

@@ -305,3 +305,3 @@ - RHEL 8/9

This documentation is built from the client's source using [JSDocs
v3](http://usejsdoc.org/index.html) for every release.
v4](https://www.npmjs.com/package/jsdoc) for every release.

@@ -308,0 +308,0 @@ The API docs also contain a few basic tutorials:

@@ -0,1 +1,2 @@

const os = require('node:os')
const fs = require('fs')

@@ -6,69 +7,49 @@ const util = require('util')

const rm = util.promisify(fs.rm)
const dict = {
Linux: 'linux',
Darwin: 'darwin',
arm64: 'arm64',
x86_64: 'x64',
aarch64: 'arm64'
}
;(async function () {
let output = await exec('uname -s')
const os = output.stdout.trim()
output = await exec('uname -m')
const arch = output.stdout.trim()
output = await exec('openssl version')
const version = output.stdout
const openssl = version.split(' ')[1].slice(0, 1)
const deleteList = []
if (dict[os] === 'linux') {
deleteList.push('lib/binding/node-v115-darwin-arm64')
deleteList.push('lib/binding/node-v111-darwin-arm64')
deleteList.push('lib/binding/node-v108-darwin-arm64')
deleteList.push('lib/binding/node-v93-darwin-arm64')
deleteList.push('lib/binding/node-v115-darwin-x64')
deleteList.push('lib/binding/node-v111-darwin-x64')
deleteList.push('lib/binding/node-v108-darwin-x64')
deleteList.push('lib/binding/node-v93-darwin-x64')
const platform = await os.platform()
if (dict[arch] === 'arm64') {
await rename('lib/binding/openssl@' + openssl + '/node-v115-linux-arm64', 'lib/binding/node-v115-linux-arm64')
await rename('lib/binding/openssl@' + openssl + '/node-v111-linux-arm64', 'lib/binding/node-v111-linux-arm64')
await rename('lib/binding/openssl@' + openssl + '/node-v108-linux-arm64', 'lib/binding/node-v108-linux-arm64')
await rename('lib/binding/openssl@' + openssl + '/node-v93-linux-arm64', 'lib/binding/node-v93-linux-arm64')
const arch = await os.arch()
if (platform === 'darwin') {
rm('lib/binding/node-v115-win32-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-win32-x64', { recursive: true, force: true })
if (arch === 'x64') {
rm('lib/binding/node-v115-darwin-arm64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-arm64', { recursive: true, force: true })
} else {
await rename('lib/binding/openssl@' + openssl + '/node-v115-linux-x64', 'lib/binding/node-v115-linux-x64')
await rename('lib/binding/openssl@' + openssl + '/node-v111-linux-x64', 'lib/binding/node-v111-linux-x64')
await rename('lib/binding/openssl@' + openssl + '/node-v108-linux-x64', 'lib/binding/node-v108-linux-x64')
await rename('lib/binding/openssl@' + openssl + '/node-v93-linux-x64', 'lib/binding/node-v93-linux-x64')
rm('lib/binding/node-v115-darwin-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-x64', { recursive: true, force: true })
}
await rm('lib/binding/openssl@3', { recursive: true, force: true })
await rm('lib/binding/openssl@1', { recursive: true, force: true })
await rm(deleteList[0], { recursive: true, force: true })
await rm(deleteList[1], { recursive: true, force: true })
await rm(deleteList[2], { recursive: true, force: true })
await rm(deleteList[3], { recursive: true, force: true })
await rm(deleteList[4], { recursive: true, force: true })
await rm(deleteList[5], { recursive: true, force: true })
await rm(deleteList[6], { recursive: true, force: true })
await rm(deleteList[7], { recursive: true, force: true })
} else if (platform === 'win32') {
rm('lib/binding/node-v115-darwin-arm64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-arm64', { recursive: true, force: true })
rm('lib/binding/node-v115-darwin-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-x64', { recursive: true, force: true })
await rm('lib/binding/openssl@3', { recursive: true, force: true })
await rm('lib/binding/openssl@1', { recursive: true, force: true })
} else {
if (dict[arch] === 'arm64') {
deleteList.push('lib/binding/node-v115-darwin-x64')
deleteList.push('lib/binding/node-v111-darwin-x64')
deleteList.push('lib/binding/node-v108-darwin-x64')
deleteList.push('lib/binding/node-v93-darwin-x64')
rm('lib/binding/node-v115-win32-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-win32-x64', { recursive: true, force: true })
rm('lib/binding/node-v115-darwin-arm64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-arm64', { recursive: true, force: true })
rm('lib/binding/node-v115-darwin-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-x64', { recursive: true, force: true })
const output = await exec('openssl version')
const version = output.stdout
const openssl = version.split(' ')[1].slice(0, 1)
if (arch === 'x64') {
await rename('lib/binding/openssl@' + openssl + '/node-v115-linux-x64', 'lib/binding/node-v115-linux-x64')
await rename('lib/binding/openssl@' + openssl + '/node-v108-linux-x64', 'lib/binding/node-v108-linux-x64')
} else {
deleteList.push('lib/binding/node-v115-darwin-arm64')
deleteList.push('lib/binding/node-v111-darwin-arm64')
deleteList.push('lib/binding/node-v108-darwin-arm64')
deleteList.push('lib/binding/node-v93-darwin-arm64')
await rename('lib/binding/openssl@' + openssl + '/node-v115-linux-arm64', 'lib/binding/node-v115-linux-arm64')
await rename('lib/binding/openssl@' + openssl + '/node-v108-linux-arm64', 'lib/binding/node-v108-linux-arm64')
}
await rm('lib/binding/openssl@3', { recursive: true, force: true })
await rm('lib/binding/openssl@1', { recursive: true, force: true })
await rm(deleteList[0], { recursive: true, force: true })
await rm(deleteList[1], { recursive: true, force: true })
await rm(deleteList[2], { recursive: true, force: true })
await rm(deleteList[3], { recursive: true, force: true })
}
})()

@@ -87,2 +87,430 @@ // *****************************************************************************

describe('clear', function () {
it('removes all items in a map', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.clear(
exp.binList('tags')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: [] })
})
it('selects item identified by index inside nested map', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.clear(
exp.binList('tags'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', []] })
})
})
describe('removeByValue', function () {
it('removes list item by value', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByValue(
exp.binList('tags'),
exp.str('green')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'yellow'] })
})
it('removes list item by value in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByValue(
exp.binList('tags'),
exp.str('white'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'pink', 'black']] })
})
})
describe('removeByValueList', function () {
it('removes list item by value list', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByValueList(
exp.binList('tags'),
exp.list(['green', 'yellow'])),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue'] })
})
it('removes list item by value list in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByValueList(
exp.binList('tags'),
exp.list(['orange', 'white']),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'black']] })
})
})
describe('removeByValueRange', function () {
it('removes list item by value range', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByValueRange(
exp.binList('tags'),
exp.str('green'),
exp.str('blue')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['green', 'yellow'] })
})
it('removes list item by value range in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByValueRange(
exp.binList('tags'),
exp.str('pink'),
exp.str('black'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white']] })
})
})
describe('removeByRelRankRangeToEnd', function () {
it('removes list item by value relative rank range to end', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByRelRankRangeToEnd(
exp.binList('tags'),
exp.int(1),
exp.str('blue')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue'] })
})
it('removes list item by value relative rank range to end in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByRelRankRangeToEnd(
exp.binList('tags'),
exp.int(1),
exp.str('orange'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'black']] })
})
})
describe('removeByRelRankRange', function () {
it('removes list item by value relative rank range', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByRelRankRange(
exp.binList('tags'),
exp.int(1),
exp.int(-1),
exp.str('green')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['green', 'yellow'] })
})
it('removes list item by value relative rank range in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByRelRankRange(
exp.binList('tags'),
exp.int(1),
exp.int(-1),
exp.str('pink'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white', 'black']] })
})
})
describe('removeByIndex', function () {
it('removes a list item by index', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndex(
exp.binList('tags'),
exp.int(1)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'yellow'] })
})
it('removes a list item by index in a cdt context in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndex(
exp.binList('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'white', 'black']] })
})
})
describe('removeByIndexRangeToEnd', function () {
it('removes a list item by index range to end', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndexRangeToEnd(
exp.binList('tags'),
exp.int(1)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue'] })
})
it('removes a list item by index range to end in a cdt context in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndexRangeToEnd(
exp.binList('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange']] })
})
})
describe('removeByIndexRange', function () {
it('removes a list item by index range', async function () {
const key = await createRecord({ tags: ['blue', 'green', 'yellow'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndexRange(
exp.binList('tags'),
exp.int(2),
exp.int(0)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['yellow'] })
})
it('removes a list item by index range in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByIndexRange(
exp.binList('tags'),
exp.int(2),
exp.int(0),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['white', 'black']] })
})
})
describe('removeByRank', function () {
it('removes a list item by rank', async function () {
const key = await createRecord({ tags: ['yellow', 'green', 'blue'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByRank(
exp.binList('tags'),
exp.int(2)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['green', 'blue'] })
})
it('removes a list item by rank in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByRank(
exp.binList('tags'),
exp.int(2),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'white', 'black']] })
})
})
describe('removeByRankRangeToEnd', function () {
it('removes a list item by rank range to end', async function () {
const key = await createRecord({ tags: ['yellow', 'green', 'blue'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByRankRangeToEnd(
exp.binList('tags'),
exp.int(1)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue'] })
})
it('removes a list item by rank range to end in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByRankRangeToEnd(
exp.binList('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['black']] })
})
})
describe('removeByRankRange', function () {
it('removes a list item by rank range', async function () {
const key = await createRecord({ tags: ['yellow', 'green', 'blue'] })
const ops = [
exp.operations.write('tags',
exp.lists.removeByRankRange(
exp.binList('tags'),
exp.int(2),
exp.int(0)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['yellow'] })
})
it('removes a list item by rank range in a cdt context', async function () {
const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] })
const context = new Context().addListIndex(2)
const ops = [
exp.operations.write('tags',
exp.lists.removeByRankRange(
exp.binList('tags'),
exp.int(2),
exp.int(0),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white']] })
})
})
describe('getByValue', function () {

@@ -296,3 +724,3 @@ it('matches the count of the matched list values', async function () {

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5])

@@ -312,3 +740,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, 6])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5, [4]])

@@ -329,3 +757,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 6]])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5])

@@ -345,3 +773,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, 2, 3, 4, 5])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5, [80, 90, 100]])

@@ -362,3 +790,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [80, 90, 100, 2, 3, 4, 5, [80, 90, 100]]])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5])

@@ -378,3 +806,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 6, 4, 5])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5, [4, 1, 9]])

@@ -394,3 +822,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 1, 7, 9]])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, 4, 5])

@@ -410,3 +838,3 @@ expect(result.bins.ExpVar).to.eql([2, 2, 3, 4, 5, 3, 4, 5])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.list).to.eql([2, 3, [9, 9]])

@@ -430,3 +858,3 @@ expect(result.bins.ExpVar).to.eql([2, 3, [9, 2, 3, [9, 9], 9]])

const result = await client.operate(key, ops, {})
// console.log(result)
expect(result.bins.ExpVar).to.eql([5, 5, 4, 4, 3, 3, 2, 2])

@@ -446,4 +874,3 @@ expect(result.bins.list).to.eql([2, 2, 3, 4, 5, 3, 4, 5])

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]])

@@ -450,0 +877,0 @@ expect(result.bins.list).to.eql([2, 3, 4, 5, [9, 100]])

@@ -112,2 +112,963 @@ // *****************************************************************************

describe('removeByKey', function () {
it('removes map item by key', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKey(
exp.binMap('tags'),
exp.str('a')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } })
})
it('removes map item by key in a cdt context', 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.write('tags',
exp.maps.removeByKey(
exp.binMap('tags'),
exp.str('e'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } })
})
})
describe('removeByKeyList', function () {
it('removes map item by key list', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyList(
exp.binMap('tags'),
exp.list(['a', 'b'])),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'yellow' } })
})
it('removes map item by key list in a cdt context', 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.write('tags',
exp.maps.removeByKeyList(
exp.binMap('tags'),
exp.list(['d', 'e']),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } })
})
})
describe('removeByKeyRange', function () {
it('removes map item by key range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRange(
exp.binMap('tags'),
exp.str('c'),
exp.str('a')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'yellow' } })
})
it('removes map item by key range in a cdt context', 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.write('tags',
exp.maps.removeByKeyRange(
exp.binMap('tags'),
exp.str('h'),
exp.str('e'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } })
})
it('removes inverted map item by key range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRange(
exp.binMap('tags'),
exp.str('c'),
exp.str('a'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } })
})
it('removes inverted map item by key range in a cdt context', 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.write('tags',
exp.maps.removeByKeyRange(
exp.binMap('tags'),
exp.str('h'),
exp.str('e'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } })
})
})
describe('removeByKeyRelIndexRangeToEnd', function () {
it('removes map item by key relative index range to end', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRelIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('b')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } })
})
it('removes map item by key relative index range to end in a cdt context', 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.write('tags',
exp.maps.removeByKeyRelIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('e'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } })
})
it('removes inverted map item by key relative index range to end', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRelIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('b'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'yellow' } })
})
it('removes inverted map item by key relative index range to end in a cdt context', 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.write('tags',
exp.maps.removeByKeyRelIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('e'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } })
})
})
describe('removeByKeyRelIndexRange', function () {
it('removes map item by key relative index range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRelIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
exp.str('a')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'yellow' } })
})
it('removes map item by key relative index range in a cdt context', 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.write('tags',
exp.maps.removeByKeyRelIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
exp.str('d'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } })
})
it('removes inverted map item by key relative index range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByKeyRelIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
exp.str('a'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } })
})
it('removes inverted map item by key relative index range in a cdt context', 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.write('tags',
exp.maps.removeByKeyRelIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
exp.str('a'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } })
})
})
describe('removeByValue', function () {
it('removes map item by value', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValue(
exp.binMap('tags'),
exp.str('green')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', c: 'yellow' } })
})
it('removes map item by value in a cdt context', 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.write('tags',
exp.maps.removeByValue(
exp.binMap('tags'),
exp.str('white'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', g: 'black' } } })
})
})
describe('removeByValueList', function () {
it('removes map item by value list', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueList(
exp.binMap('tags'),
exp.list(['green', 'yellow'])),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue' } })
})
it('removes map item by value list in a cdt context', 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.write('tags',
exp.maps.removeByValueList(
exp.binMap('tags'),
exp.list(['orange', 'white']),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', g: 'black' } } })
})
})
describe('removeByValueRange', function () {
it('removes map item by value range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRange(
exp.binMap('tags'),
exp.str('green'),
exp.str('blue')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } })
})
it('removes map item by value range in a cdt context', 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.write('tags',
exp.maps.removeByValueRange(
exp.binMap('tags'),
exp.str('pink'),
exp.str('black'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white' } } })
})
it('removes inverted map item by value range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRange(
exp.binMap('tags'),
exp.str('green'),
exp.str('blue'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue' } })
})
it('removes inverted map item by value range in a cdt context', 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.write('tags',
exp.maps.removeByValueRange(
exp.binMap('tags'),
exp.str('pink'),
exp.str('black'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } })
})
})
describe('removeByValueRelRankRangeToEnd', function () {
it('removes map item by value relative rank range to end', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRelRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('blue')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'blue' } })
})
it('removes map item by value relative rank range to end in a cdt context', 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.write('tags',
exp.maps.removeByValueRelRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('orange'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } })
})
it('removes inverted map item by value relative rank range to end', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRelRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('blue'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } })
})
it('removes inverted map item by value relative rank range to end in a cdt context', 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.write('tags',
exp.maps.removeByValueRelRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
exp.str('black'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white' } } })
})
})
describe('removeByValueRelRankRange', function () {
it('removes map item by value relative rank range', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRelRankRange(
exp.binMap('tags'),
exp.int(1),
exp.int(-1),
exp.str('green')),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } })
})
it('removes map item by value relative rank range in a cdt context', 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.write('tags',
exp.maps.removeByValueRelRankRange(
exp.binMap('tags'),
exp.int(1),
exp.int(-1),
exp.str('pink'),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } })
})
it('removes inverted map item by value relative rank range', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByValueRelRankRange(
exp.binMap('tags'),
exp.int(1),
exp.int(-1),
exp.str('green'),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'blue' } })
})
it('removes inverted map item by value relative rank range in a cdt context', 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.write('tags',
exp.maps.removeByValueRelRankRange(
exp.binMap('tags'),
exp.int(1),
exp.int(-1),
exp.str('pink'),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } })
})
})
describe('removeByIndex', function () {
it('removes a map item by index', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByIndex(
exp.binMap('tags'),
exp.int(1)),
0),
op.read('tags')
]
let result = await client.operate(key, ops, {})
result = await client.get(key)
console.log(result)
expect(result.bins).to.eql({ tags: { a: 'blue', c: 'yellow' } })
})
it('removes a map item by index in a cdt context in a cdt context', 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.write('tags',
exp.maps.removeByIndex(
exp.binMap('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
let result = await client.operate(key, ops, {})
result = await client.get(key)
console.log(result)
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } })
})
})
describe('removeByIndexRangeToEnd', function () {
it('removes a map item by index range to end', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue' } })
})
it('removes a map item by index range to end in a cdt context in a cdt context', 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.write('tags',
exp.maps.removeByIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } })
})
it('removes an inverted map item by index range to end', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } })
})
it('removes an inverted map item by index range to end in a cdt context', 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.write('tags',
exp.maps.removeByIndexRangeToEnd(
exp.binMap('tags'),
exp.int(1),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } })
})
})
describe('removeByIndexRange', function () {
it('removes a map item by index range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'yellow' } })
})
it('removes a map item by index range in a cdt context', 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.write('tags',
exp.maps.removeByIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } })
})
it('removes a inverted map item by index range', async function () {
const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } })
})
it('removes a inverted map item by index range in a cdt context', 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.write('tags',
exp.maps.removeByIndexRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } })
})
})
describe('removeByRank', function () {
it('removes a map item by rank', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByRank(
exp.binMap('tags'),
exp.int(2)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { b: 'green', c: 'blue' } })
})
it('removes a map item by rank in a cdt context', 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.write('tags',
exp.maps.removeByRank(
exp.binMap('tags'),
exp.int(2),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } })
})
})
describe('removeByRankRangeToEnd', function () {
it('removes a map item by rank range to end', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByRankRangeToEnd(
exp.binMap('tags'),
exp.int(1)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { c: 'blue' } })
})
it('removes a map item by rank range to end in a cdt context', 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.write('tags',
exp.maps.removeByRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { g: 'black' } } })
})
it('removes an inverted map item by rank range to end', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } })
})
it('removes an inverted map item by rank range to end in a cdt context', 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.write('tags',
exp.maps.removeByRankRangeToEnd(
exp.binMap('tags'),
exp.int(1),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white' } } })
})
})
describe('removeByRankRange', function () {
it('removes a map item by rank range', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByRankRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0)),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'yellow' } })
})
it('removes a map item by rank range in a cdt context', 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.write('tags',
exp.maps.removeByRankRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
context),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white' } } })
})
it('removes an inverted map item by rank range', async function () {
const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } })
const ops = [
exp.operations.write('tags',
exp.maps.removeByRankRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
null,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { b: 'green', c: 'blue' } })
})
it('removes an inverted map item by rank range in a cdt context', 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.write('tags',
exp.maps.removeByRankRange(
exp.binMap('tags'),
exp.int(2),
exp.int(0),
context,
maps.returnType.INVERTED),
0),
op.read('tags')
]
const result = await client.operate(key, ops, {})
expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } })
})
})
describe('getByIndex', function () {

@@ -268,2 +1229,17 @@ it('selects item identified by index', async function () {

describe('getByKeyList', 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.getByKeyList(exp.binMap('tags'), exp.list(['a', 'b']), maps.returnType.COUNT), exp.int(1)))
await testMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['a', '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', f: 'white', g: 'black' } } })
const context = new Context().addMapKey('nested')
await testNoMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['d', 'e']), maps.returnType.COUNT, context), exp.int(1)))
await testMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['d', 'e']), maps.returnType.COUNT, context), exp.int(2)))
})
})
describe('getByKeyRange', function () {

@@ -298,3 +1274,3 @@ it('matches the count of the matched map values', async function () {

})
/*
describe('getByKeyRelIndexRangeToEnd', function () {

@@ -310,7 +1286,7 @@ it('matches the count of the matched map values', async function () {

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)))
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 () {

@@ -479,3 +1455,2 @@ it('selects map item identified by rank', async function () {

/*
describe('getByValueList', function () {

@@ -485,4 +1460,4 @@ it('matches the count of the matched values', async function () {

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)))
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(2)))
})

@@ -494,7 +1469,6 @@

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)))
await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['orange', 'white']), maps.returnType.COUNT, context), exp.int(3)))
await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['orange', 'white']), maps.returnType.COUNT, context), exp.int(2)))
})
})
*/

@@ -501,0 +1475,0 @@ describe('getByValueRange', function () {

@@ -25,2 +25,3 @@ // *****************************************************************************

const op = Aerospike.operations
const maps = Aerospike.maps

@@ -240,2 +241,29 @@ const GeoJSON = Aerospike.GeoJSON

describe('nil', function () {
it('evaluates to true if any expression evaluates to true', 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('green'), exp.nil(), maps.returnType.COUNT), exp.int(2)))
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('green'), exp.nil(), maps.returnType.COUNT), exp.int(1)))
})
})
describe('inf', function () {
it('evaluates to true if any expression evaluates to true', 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.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(1)))
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(2)))
})
})
describe('wildcard', function () {
it('evaluates to true if any expression evaluates to true', 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.inf(), exp.wildcard(), maps.returnType.COUNT), exp.int(2)))
await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.wildcard(), maps.returnType.COUNT), exp.int(3)))
})
})
describe('arithmetic expressions', function () {

@@ -242,0 +270,0 @@ describe('int bin add expression', function () {

@@ -256,2 +256,12 @@ // *****************************************************************************

it('adds each item from the Map class to the map and returns the size of the map', function () {
console.log(maps.putItems('map', new Map([['e', 150], ['d', 100], ['c', 99]])))
return initState()
.then(createRecord({ map: { a: 1, b: 2, c: 3 } }))
.then(operate(maps.putItems('map', new Map([['e', 150], ['d', 100], ['c', 99]]))))
.then(assertResultEql({ map: 5 }))
.then(assertRecordEql({ map: { a: 1, b: 2, c: 99, d: 100, e: 150 } }))
.then(cleanup())
})
context('with update-only flag', function () {

@@ -258,0 +268,0 @@ helper.skipUnlessVersion('>= 4.3.0', this)

@@ -243,7 +243,8 @@ // *****************************************************************************

it.skip('writes bin with Map value as map and reads it back', function (done) {
it('writes bin with Map value as map and reads it back as an ordered object', function (done) {
const record = {
map: new Map([['a', 1], ['b', 'foo'], ['c', 1.23],
map: new Map([['g', [1, 2, 3]], ['h', { a: 1, b: 2 }], ['j', new Map([['b', 'foo'], ['a', 1]])],
['d', new Double(3.14)], ['e', Buffer.from('bar')], ['f', GeoJSON.Point(103.8, 1.283)],
['g', [1, 2, 3]], ['h', { a: 1, b: 2 }]])
['a', 1], ['b', 'foo'], ['c', 1.23]]
)
}

@@ -259,3 +260,4 @@ const expected = {

g: [1, 2, 3],
h: { a: 1, b: 2 }
h: { a: 1, b: 2 },
j: { a: 1, b: 'foo' }
}

@@ -266,2 +268,30 @@ }

it('writes bin with the Bin class and reads it back as an object', function (done) {
const record = new Aerospike.Bin('map', {
g: [1, 2, 3],
h: { a: 1, b: 2 },
j: new Map([['b', 'foo'], ['a', 1]]),
e: Buffer.from('bar'),
f: '{"type":"Point","coordinates":[103.8,1.283]}',
a: 1,
b: 'foo',
c: 1.23,
d: 3.14
})
const expected = {
map: {
a: 1,
b: 'foo',
c: 1.23,
d: 3.14,
e: Buffer.from('bar'),
f: '{"type":"Point","coordinates":[103.8,1.283]}',
g: [1, 2, 3],
h: { a: 1, b: 2 },
j: { a: 1, b: 'foo' }
}
}
putGetVerify(record, expected, done)
})
context('BigInt values', function () {

@@ -268,0 +298,0 @@ helper.skipUnless(this, bigint.bigIntSupported, 'BigInt not supported in this Node.js version')

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc