Skip to content

Commit

Permalink
Merge pull request #579 from aerospike/Nodejs-Release-5.8.0
Browse files Browse the repository at this point in the history
Nodejs release 5.8.0
  • Loading branch information
DomPeliniAerospike authored Sep 22, 2023
2 parents 3de77fc + e943c75 commit f7178b2
Show file tree
Hide file tree
Showing 22 changed files with 3,570 additions and 3,338 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:
strategy:
matrix:
node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- 16.x
- 18.x
- 19.x
- 20.x
continue-on-error: true
steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ jobs:
strategy:
matrix:
node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- 16.x
- 18.x
- 19.x
- 20.x
continue-on-error: true
name: Node ${{ matrix.node-version }} tester
Expand Down
21 changes: 19 additions & 2 deletions jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,27 @@
"domain": "aerospike.com"
}
},
"docdash": {
"sectionOrder": [
"Modules",
"Classes",
"Events",
"Tutorials",
"Global"
],"meta": {
"title": "Aerospike Node.js Client API Documentation",
"description": "Explore the comprehensive documentation for the Aerospike Node.js Client API, covering usage, configuration, and examples. Learn how to integrate Aerospike with your Node.js applications efficiently.",
"keyword": "Aerospike, Node.js, Client API, Documentation, Usage, Configuration, Examples, Integration"
}
},
"opts": {
"destination": "./build/apidocs",
"template": "./node_modules/ink-docstrap/template",
"template": "./node_modules/docdash",
"readme": "./docs/overview.md",
"tutorials" : "./docs/tutorials"
"tutorials" : "./docs/tutorials",
"recurse": true,
"verbose": true
}


}
8 changes: 8 additions & 0 deletions lib/aerospike.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ exports.Key = require('./key')
*/
exports.Record = require('./record')

/**
* 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')

// ========================================================================
// Enumerations
// ========================================================================
Expand Down
59 changes: 59 additions & 0 deletions lib/bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// *****************************************************************************
// Copyright 2023 Aerospike, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// *****************************************************************************

'use strict'

/**
* @class Bin
* @classdesc Aerospike Bin
*
* 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). The major difference
* between bins and RDBMS columns is that you don't need to define a schema. Each record can
* have multiple bins. Bins accept the data types listed {@link https://docs.aerospike.com/apidocs/nodejs/#toc4__anchor|here}.
*
* For information about these data types and how bins support them, see {@link https://docs.aerospike.com/server/guide/data-types/scalar-data-types|this}.
*
* Although the bin for a given record or object must be typed, bins in different rows do not
* have to be the same type. There are some internal performance optimizations for single-bin namespaces.
*
* @summary Construct a new Aerospike Bin instance.
*
*/
class Bin {
/** @private */
constructor (name, value, mapOrder) {
/**
* Bin name.
*
* @member {String} Bin#name
*/
this.name = name

/**
* Bin value.
*
* @member {Any} Bin#value
*/
if (mapOrder === 1) {
this.value = new Map(Object.entries(value))
} else {
this.value = value
}
}
}

module.exports = Bin
16 changes: 16 additions & 0 deletions lib/exp.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ exports.geo = _valueExp(exp.ops.VAL_GEO, 'value')
*/
exports.nil = () => [{ op: exp.ops.AS_VAL, value: null }]

/**
* 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')

/**
Expand Down
44 changes: 22 additions & 22 deletions lib/exp_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -465,9 +465,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -483,9 +483,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...end,
...bin
Expand All @@ -500,9 +500,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...rank,
...bin
Expand All @@ -519,9 +519,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...rank,
...count,
Expand All @@ -536,9 +536,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -551,9 +551,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -567,9 +567,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...count,
...bin
Expand All @@ -583,9 +583,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -598,9 +598,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...bin
],
Expand All @@ -614,9 +614,9 @@ module.exports = {
* @param {AerospikeExp} ctx Optional context path for nested CDT.
* @return {AerospikeExp} (list expression)
*/
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,
...count,
...bin
Expand Down
Loading

0 comments on commit f7178b2

Please sign in to comment.