Skip to content

Commit

Permalink
Merge pull request #581 from aerospike/stage
Browse files Browse the repository at this point in the history
Nodejs-Release-5.8.0
  • Loading branch information
mcoberly2 authored Sep 28, 2023
2 parents a969a6b + 2c5f49e commit 4d2929f
Show file tree
Hide file tree
Showing 28 changed files with 4,156 additions and 3,646 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

The Aerospike Node.js client is a Node.js add-on module, written using V8.

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:
- RHEL 8/9
- Debian 10 (x86_64 architecture only)
Expand Down Expand Up @@ -301,7 +301,7 @@ const Aerospike = require('aerospike')
Access the client API documentation at:
[https://docs.aerospike.com/apidocs/nodejs](https://docs.aerospike.com/apidocs/nodejs).
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.

The API docs also contain a few basic tutorials:

Expand Down
5 changes: 5 additions & 0 deletions incompatible.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Backward Incompatible API Changes

All notable changes to this project will be documented in this file.
## [5.8.0]

### Client no longer supports Node.js version 19
### Client no longer supports Node.js version 16

## [5.5.0]

### Client no longer supports Node.js version 14
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
9 changes: 5 additions & 4 deletions lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
const status = require('./status')

/**
* 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
* @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.
*
* @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>
*
Expand All @@ -49,7 +51,6 @@ const status = require('./status')
* })
*/
class AerospikeError extends Error {
/** @private */
constructor (message, command) {
super(message)
this.name = this.constructor.name
Expand Down
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 4d2929f

Please sign in to comment.