Skip to content

Commit

Permalink
Merge pull request #545 from aerospike/stage
Browse files Browse the repository at this point in the history
Nodejs-release-5.3.0
  • Loading branch information
DomPeliniAerospike authored Mar 28, 2023
2 parents 5855683 + 0ac55a9 commit 2c10d8a
Show file tree
Hide file tree
Showing 18 changed files with 1,326 additions and 467 deletions.
2 changes: 1 addition & 1 deletion lib/cdt_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class CdtContext {
*/
static getContextType (/* CdtContext */ctx, type) {
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
}
return type
}
Expand Down
6 changes: 2 additions & 4 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,10 @@ Client.prototype.batchApply = function (records, udf, batchPolicy, batchApplyPol
*
* @description
*
* This method allows multi sub-commands for each key in the batch.
* This method removes the specified records from the database.
* This method requires server >= 6.0.0.
*
* @param {object[]} records - {@link Record} List of batch sub-commands to perform.
* @param {number} records[].type - {@link Record#type} Batch type.
* @param {Key} records[].key - Record Key.
* @param {Key[]} keys - {@link Key} An array of keys, used to locate the records in the cluster.
* @param {BatchPolicy} [batchPolicy] - The Batch Policy to use for this operation.
* @param {BatchRemovePolicy} [batchRemovePolicy] Remove policy configuration parameters.
* @param {batchRecordsCallback} [callback] - The function to call when
Expand Down
186 changes: 94 additions & 92 deletions lib/exp_lists.js

Large diffs are not rendered by default.

240 changes: 124 additions & 116 deletions lib/exp_maps.js

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions lib/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,29 @@ exports.getByKey = function (bin, key, returnType) {
return op
}

/**
* @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
* map.
Expand Down Expand Up @@ -1028,6 +1051,30 @@ exports.getByValue = function (bin, value, returnType) {
return op
}

/**
* @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
* the map.
Expand Down
Loading

0 comments on commit 2c10d8a

Please sign in to comment.