diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index ae50e246..b310fab1 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -30,7 +30,7 @@ jobs:
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- - 18.x
+ - 20.x
steps:
- name: Checkout repository
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
index 139f4420..92026c2d 100644
--- a/.github/workflows/linux-build.yml
+++ b/.github/workflows/linux-build.yml
@@ -23,10 +23,10 @@ jobs:
strategy:
matrix:
node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- - 14.x
- 16.x
- 18.x
- 19.x
+ - 20.x
continue-on-error: true
steps:
- uses: actions/checkout@v2
diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml
index fabd17d4..158aea8f 100644
--- a/.github/workflows/windows-build.yml
+++ b/.github/workflows/windows-build.yml
@@ -32,6 +32,7 @@ jobs:
- 16.x
- 18.x
- 19.x
+ - 20.x
continue-on-error: true
name: Node ${{ matrix.node-version }} tester
steps:
diff --git a/.travis/start_cluster.sh b/.travis/start_cluster.sh
index 49189579..98ad8e62 100755
--- a/.travis/start_cluster.sh
+++ b/.travis/start_cluster.sh
@@ -1,6 +1,6 @@
#!/bin/bash
################################################################################
-# Copyright 2013-2017 Aerospike, Inc.
+# Copyright 2013-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.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5698cfa..baac19b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,99 @@
# Changelog
All notable changes to this project will be documented in this file.
+## [5.5.0]
+
+* **Breaking Changes**
+ * [CLIENT-2343] - Dropped support for Node.js 14
+
+* **New Features**
+ * [CLIENT-2108] - Added pagination support for queries and scans.
+ * [CLIENT-2224] - Added support for rack aware reads when the replication factor is three.
+ * [CLIENT-2303] - Added support for Amazon Linux 2023.
+ * [CLIENT-2342] - Added support for Node.js 20
+
+* **Improvements**
+ * [CLIENT-1819] - Fixed issue which caused the configuration class property "rackId" to be ignored.
+
+* **Bug Fixes**
+ * [CLIENT-2231] - Fixed expression API documentation to show parameters for functions.
+
+## [5.4.0]
+* The new features require Aerospike Server version 6.3 or newer.
+
+* **Breaking Changes**
+ * Dropped support for:
+ * Ubuntu 18.04
+ * Debian 10 (ARM64 only).
+
+* **New Features**
+ * [CLIENT-2178] - Added ORDERED_MAP and UNORDERED_MAP map operation return types.
+ * [CLIENT-2187] - Added comparison of map values using expressions.
+
+## [5.3.0]
+
+* **New Features**
+ * [CLIENT-1750] - Added 'returnType.EXISTS' for 'aerospike/maps' and 'aerospike/list' module read operations. This feature requires server version 6.1+.
+ * [CLIENT-1818] - Added the 'getByKeyList' method 'aerospike/maps' module.
+ * [CLIENT-2210] - Added the 'getByValueList' method 'aerospike/maps' module.
+
+* **Improvements**
+ * [CLIENT-1819] - Corrected 'Client.batchApply' to have a keys parameter rather than a records parameter.
+
+* **Bug Fixes**
+ * [CLIENT-2231] - Fixed segmentation fault caused by using context with map and list expressions. Added unit tests for map and list expressions using context. Fixed parameter order for map and list expression methods.
+
+## [5.2.2]
+* **Improvements**
+ * [CLIENT-2202] - Corrected default values for MaxConnsPerNode, maxSocketIdle, and totalTimeout policies within the API documentation.
+
+* **Bug Fixes**
+ * [CLIENT-2195] - Reworked batch write to accommodate promises and callbacks. Batch write will no longer return "AEROSPIKE_BATCH_FAILED" as an error, and will instead return results with status codes detailing the status of each batch operation.
+
+## [5.2.1]
+
+* **New Features**
+ * [CLIENT-1248] - AddListIndexCreate and AddMapKeyCreate added to cdt_context.js.
+
+* **Improvements**
+ * [CLIENT-2011] - Batch writes now returns the results of transactions ending in the AEROSPIKE_BATCH_FAILED status as well as the status of each record.
+ * [CLIENT-2150] - Reduced install size from 500MB to 166MB.
+
+* **Bug Fixes**
+ * [CLIENT-2167] - Fixed broken API documentation links.
+ * [CLIENT-2168] - Added missing methods from operations classes.
+
+## [5.2.0]
+
+* **Updates**
+ * BREAKING: Client does not support Node.js LTS version 14 on macOS using ARM architecture - see Incompatible API Changes for details.
+ * Added support for
+ * Node.js 19
+ * Ubuntu 22.04
+ * RHEL 9
+ * Dropped support for:
+ * Node.js 10, 12, 17
+ * RHEL 7
+ * Debian 8, 9
+
+* **New Features**
+ * [CLIENT-2000] - Added ARM architecture support for all currently supported OS systems.
+
+## [5.1.1]
+
+* **Bug Fixes**
+ * [CLIENT-1944] - Node.js: Revamped existing API documentation.
+ * [CLIENT-1943] - Node.js: Added documentation for list, map, hll, and bit expressions
+ * [CLIENT-1942] - Node.js: Improved examples within the API documentation.
+
+## [5.0.3]
+
+* **Updates**
+ * Debian 9 Stretch LTS has reached its End of Life on June 30 2022. We will drop support for Debian 9 in an upcoming client release.
+
+* **Bug Fixes**
+ * [CLIENT-1778] Node.js: document client support for PKI auth.
+ * [CLIENT-1762] Add Node.js client TypeScript support.
## [5.0.2]
diff --git a/README.md b/README.md
index e2f61caf..66c9b64a 100644
--- a/README.md
+++ b/README.md
@@ -11,11 +11,12 @@
The Aerospike Node.js client is a Node.js add-on module, written using V8.
-The client is compatible with Node.js 19, 18 (LTS), 16 (LTS) and 14 (LTS).
+The client is compatible with Node.js 20 (LTS), 19, 18 (LTS), 16 (LTS).
It supports the following operating systems:
- RHEL 8/9
- Debian 10 (x86_64 architecture only)
- Debian 11
+- Amazon Linux 2023
- Ubuntu 20.04/22.04 (Focal Fossa, Jammy Jellyfish)
- Many Linux distributions compatible with one of the above OS releases.
- macOS versions 11/12/13 are also supported. (Node.js 14 install unavailable on M1 Mac systems)
diff --git a/aerospike-client-c b/aerospike-client-c
index bdd08709..294084c7 160000
--- a/aerospike-client-c
+++ b/aerospike-client-c
@@ -1 +1 @@
-Subproject commit bdd08709ed5be34b634aa69682144986d1ae09b4
+Subproject commit 294084c753f98d44317b85611915bb43362ed1ca
diff --git a/benchmarks/alerts.js b/benchmarks/alerts.js
index 2f3446b9..20729bfb 100644
--- a/benchmarks/alerts.js
+++ b/benchmarks/alerts.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/inspect.js b/benchmarks/inspect.js
index 36f4de34..5bfe7441 100644
--- a/benchmarks/inspect.js
+++ b/benchmarks/inspect.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/logging.js b/benchmarks/logging.js
index bab1b1c3..f2780950 100644
--- a/benchmarks/logging.js
+++ b/benchmarks/logging.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2021 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/main.js b/benchmarks/main.js
index 95f5221b..75c24550 100644
--- a/benchmarks/main.js
+++ b/benchmarks/main.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2021 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/memory.js b/benchmarks/memory.js
index dd57bbfb..b3c0de48 100644
--- a/benchmarks/memory.js
+++ b/benchmarks/memory.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/stats.js b/benchmarks/stats.js
index f48ae744..8a39b7dd 100644
--- a/benchmarks/stats.js
+++ b/benchmarks/stats.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/benchmarks/worker.js b/benchmarks/worker.js
index 09baddbe..c55b1560 100644
--- a/benchmarks/worker.js
+++ b/benchmarks/worker.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/binding.gyp b/binding.gyp
index 0e3722b2..e94a6884 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -104,9 +104,11 @@
'src/main/commands/query_apply.cc',
'src/main/commands/query_background.cc',
'src/main/commands/query_foreach.cc',
+ 'src/main/commands/query_pages.cc',
'src/main/commands/remove_async.cc',
'src/main/commands/scan_async.cc',
'src/main/commands/scan_background.cc',
+ 'src/main/commands/scan_pages.cc',
'src/main/commands/select_async.cc',
'src/main/commands/truncate.cc',
'src/main/commands/index_create.cc',
diff --git a/examples/add.js b/examples/add.js
index f47f33e8..d940c090 100755
--- a/examples/add.js
+++ b/examples/add.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/append.js b/examples/append.js
index 65db56b3..7e63efd6 100755
--- a/examples/append.js
+++ b/examples/append.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/apply.js b/examples/apply.js
index 3ba31d70..5275c3d1 100755
--- a/examples/apply.js
+++ b/examples/apply.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/batch.js b/examples/batch.js
index cdc1725a..ba525f5d 100755
--- a/examples/batch.js
+++ b/examples/batch.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/exists.js b/examples/exists.js
index 5654a1d8..85ae7b11 100755
--- a/examples/exists.js
+++ b/examples/exists.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/geospatialMonteCarlo.js b/examples/geospatialMonteCarlo.js
index cff7670c..1ceba914 100755
--- a/examples/geospatialMonteCarlo.js
+++ b/examples/geospatialMonteCarlo.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/get.js b/examples/get.js
index c3336abd..58677eb8 100755
--- a/examples/get.js
+++ b/examples/get.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/info.js b/examples/info.js
index 1ec55ff2..b4f1f18c 100755
--- a/examples/info.js
+++ b/examples/info.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/operate.js b/examples/operate.js
index 3651dc02..a17c1b2d 100755
--- a/examples/operate.js
+++ b/examples/operate.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/put.js b/examples/put.js
index 71ecbe54..dce1ade5 100755
--- a/examples/put.js
+++ b/examples/put.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/query.js b/examples/query.js
index 0d592b22..2fa38a5a 100755
--- a/examples/query.js
+++ b/examples/query.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/remove.js b/examples/remove.js
index 113e9d9d..064f1951 100755
--- a/examples/remove.js
+++ b/examples/remove.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/run.js b/examples/run.js
index 4e454cd1..1a66fb11 100755
--- a/examples/run.js
+++ b/examples/run.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2018-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/scan.js b/examples/scan.js
index f82e207a..c335f4ca 100755
--- a/examples/scan.js
+++ b/examples/scan.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2021 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/shared/cli.js b/examples/shared/cli.js
index a4d5d722..410c1c5f 100644
--- a/examples/shared/cli.js
+++ b/examples/shared/cli.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2018 Aerospike, Inc.
+// Copyright 2018-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.
diff --git a/examples/shared/client.js b/examples/shared/client.js
index 3ebd5303..7922e77e 100644
--- a/examples/shared/client.js
+++ b/examples/shared/client.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2018-2022 Aerospike, Inc.
+// Copyright 2018-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.
diff --git a/examples/shared/index.js b/examples/shared/index.js
index 4f08a5f7..5d8b5bbf 100644
--- a/examples/shared/index.js
+++ b/examples/shared/index.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2018 Aerospike, Inc.
+// Copyright 2018-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.
diff --git a/examples/shared/run.js b/examples/shared/run.js
index bf5911d2..73342b44 100644
--- a/examples/shared/run.js
+++ b/examples/shared/run.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2018 Aerospike, Inc.
+// Copyright 2018-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.
diff --git a/examples/sindex.js b/examples/sindex.js
index 9e757195..2033a612 100755
--- a/examples/sindex.js
+++ b/examples/sindex.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/examples/udf.js b/examples/udf.js
index 9781991c..7e396ec6 100755
--- a/examples/udf.js
+++ b/examples/udf.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/incompatible.md b/incompatible.md
index bf485ae3..7df8a90f 100644
--- a/incompatible.md
+++ b/incompatible.md
@@ -1,6 +1,18 @@
# Backward Incompatible API Changes
All notable changes to this project will be documented in this file.
+## [5.5.0]
+
+### Client no longer supports Node.js version 14
+
+## [5.4.0]
+
+### Client no longer supports Ubuntu 18.04
+### Client no longer supports Debian 10 on ARM64 architecture
+
+## [5.2.0]
+
+### Client does not support Node.js LTS version 14 on macOS using ARM architecture
## [5.0.0]
diff --git a/lib/aerospike.js b/lib/aerospike.js
index 364308d1..32b71576 100644
--- a/lib/aerospike.js
+++ b/lib/aerospike.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/batch_type.js b/lib/batch_type.js
index a0c99ad7..bd501704 100644
--- a/lib/batch_type.js
+++ b/lib/batch_type.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/bigint.js b/lib/bigint.js
index 12b5b402..aa811850 100644
--- a/lib/bigint.js
+++ b/lib/bigint.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/bitwise.js b/lib/bitwise.js
index e131366c..110dd518 100644
--- a/lib/bitwise.js
+++ b/lib/bitwise.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2019 Aerospike, Inc.
+// Copyright 2019-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.
diff --git a/lib/cdt_context.js b/lib/cdt_context.js
index 53ba6dbb..6a9a6ef8 100644
--- a/lib/cdt_context.js
+++ b/lib/cdt_context.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2019 Aerospike, Inc.
+// Copyright 2019-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.
diff --git a/lib/client.js b/lib/client.js
index 482503de..8917cc47 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/batch_command.js b/lib/commands/batch_command.js
index bb2d18f3..eb0185f2 100644
--- a/lib/commands/batch_command.js
+++ b/lib/commands/batch_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/command.js b/lib/commands/command.js
index 09748077..ffa889d9 100644
--- a/lib/commands/command.js
+++ b/lib/commands/command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/connect_command.js b/lib/commands/connect_command.js
index feaf560f..17d4d8e3 100644
--- a/lib/commands/connect_command.js
+++ b/lib/commands/connect_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/exists_command.js b/lib/commands/exists_command.js
index 93a08c32..b9dd3665 100644
--- a/lib/commands/exists_command.js
+++ b/lib/commands/exists_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/index.js b/lib/commands/index.js
index 93e6fc7a..a9b37cb8 100644
--- a/lib/commands/index.js
+++ b/lib/commands/index.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
@@ -46,12 +46,14 @@ exports.JobInfo = class JobInfoCommand extends Command('jobInfo') { }
exports.Operate = class OperateCommand extends ReadRecordCommand('operateAsync') { }
exports.Put = class PutCommand extends WriteRecordCommand('putAsync') { }
exports.Query = class QueryCommand extends StreamCommand('queryAsync') { }
+exports.QueryPages = class QueryPagesCommand extends StreamCommand('queryPages') { }
exports.QueryApply = class QueryApplyCommand extends Command('queryApply') { }
exports.QueryBackground = class QueryBackgroundCommand extends QueryBackgroundBaseCommand('queryBackground') { }
exports.QueryOperate = class QueryOperateCommand extends QueryBackgroundBaseCommand('queryBackground') { }
exports.QueryForeach = class QueryForeachCommand extends StreamCommand('queryForeach') { }
exports.Remove = class RemoveCommand extends WriteRecordCommand('removeAsync') { }
exports.Scan = class ScanCommand extends StreamCommand('scanAsync') { }
+exports.ScanPages = class ScanPagesCommand extends StreamCommand('scanPages') { }
exports.ScanBackground = class ScanBackgroundCommand extends QueryBackgroundBaseCommand('scanBackground') { }
exports.ScanOperate = class ScanOperateCommand extends QueryBackgroundBaseCommand('scanBackground') { }
exports.Select = class SelectCommand extends ReadRecordCommand('selectAsync') { }
diff --git a/lib/commands/query_background_command.js b/lib/commands/query_background_command.js
index c330c0a4..2d5fb92a 100644
--- a/lib/commands/query_background_command.js
+++ b/lib/commands/query_background_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/read_record_command.js b/lib/commands/read_record_command.js
index a89d28f2..8a4ef201 100644
--- a/lib/commands/read_record_command.js
+++ b/lib/commands/read_record_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/commands/stream_command.js b/lib/commands/stream_command.js
index a1fe17b0..a2258842 100644
--- a/lib/commands/stream_command.js
+++ b/lib/commands/stream_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
@@ -20,8 +20,6 @@ const Command = require('./command')
const Key = require('../key')
const Record = require('../record')
-const EndOfStream = {}
-
module.exports = asCommand => class StreamCommand extends Command(asCommand) {
constructor (stream, args) {
super(stream.client, args)
@@ -31,8 +29,8 @@ module.exports = asCommand => class StreamCommand extends Command(asCommand) {
callback (error, record) {
if (error) {
this.stream.emit('error', error)
- } else if (record === EndOfStream) {
- this.stream.emit('end')
+ } else if ('state' in record) {
+ this.stream.emit('end', record.state)
} else {
this.stream.emit('data', record)
}
@@ -40,7 +38,7 @@ module.exports = asCommand => class StreamCommand extends Command(asCommand) {
}
convertResult (bins, meta, asKey) {
- if (!bins) return EndOfStream
+ if (!bins) return { state: meta }
const key = Key.fromASKey(asKey)
return new Record(key, bins, meta)
}
diff --git a/lib/commands/write_record_command.js b/lib/commands/write_record_command.js
index b6eee7f1..b6680948 100644
--- a/lib/commands/write_record_command.js
+++ b/lib/commands/write_record_command.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/config.js b/lib/config.js
index d24dc537..12afacf3 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/double.js b/lib/double.js
index 10c03eaf..70e050ad 100644
--- a/lib/double.js
+++ b/lib/double.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/error.js b/lib/error.js
index f1d130a7..b77b9a2d 100644
--- a/lib/error.js
+++ b/lib/error.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/event_loop.js b/lib/event_loop.js
index 6f5280c5..569f7f25 100644
--- a/lib/event_loop.js
+++ b/lib/event_loop.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2021 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/exp.js b/lib/exp.js
index a2e056f1..44bd93ef 100644
--- a/lib/exp.js
+++ b/lib/exp.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2021-2022 Aerospike, Inc.
+// Copyright 2021-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.
@@ -138,6 +138,7 @@ const _valueExpBytes = (op, valName, sizeName) => (value, size) => [{ op, [valNa
/**
* Create boolean value.
*
+ * @function
* @param {boolean} value boolean value.
* @return {AerospikeExp}
*/
@@ -146,6 +147,7 @@ exports.bool = _valueExp(exp.ops.VAL_BOOL, 'boolVal')
/**
* Create 64 bit signed integer value.
*
+ * @function
* @param {number} number value integer value.
* @return {AerospikeExp}
*/
@@ -155,6 +157,7 @@ const _int = exports.int
/**
* Create 64 bit unsigned integer value.
*
+ * @function
* @param {number} number value unsigned integer value.
* @return {AerospikeExp}
*/
@@ -163,14 +166,16 @@ exports.uint = _valueExp(exp.ops.VAL_UINT, 'uintVal')
/**
* Create 64 bit floating point value.
*
+ * @function
* @param {number} value floating point value.
- * @return {AerospikeExp}
+ * @return {AerospikeExp}
*/
exports.float = _valueExp(exp.ops.VAL_FLOAT, 'floatVal')
/**
* Create string value.
*
+ * @function
* @param {string} value string value.
* @return {AerospikeExp}
*/
@@ -178,7 +183,8 @@ exports.str = _valueExp(exp.ops.VAL_STR, 'strVal')
/**
* Create byte array value.
- *
+ * *
+ * @function
* @param {string[]} value byte array value.
* @param {number} size number of bytes.
* @return {AerospikeExp}
@@ -188,6 +194,7 @@ exports.bytes = _valueExpBytes(exp.ops.VAL_BYTES, 'bytesVal', 'sz')
/**
* Create geojson value.
*
+ * @function
* @param {Object} value geojson value.
* @return {AerospikeExp}
*/
@@ -195,11 +202,30 @@ exports.geo = _valueExp(exp.ops.VAL_GEO, 'value')
/**
* Create 'nil' value.
+ *
+ * @function
+ * @return {AerospikeExp}
*/
exports.nil = () => [{ op: exp.ops.AS_VAL, value: null }]
const _val = _valueExp(exp.ops.AS_VAL, 'value')
+
+/**
+ * Create list value.
+ *
+ * @function
+ * @param {array} value list value
+ * @return {AerospikeExp}
+ */
exports.list = _val
+
+/**
+ * Create map value.
+ *
+ * @function
+ * @param {array} value map value
+ * @return {AerospikeExp}
+ */
exports.map = _val
/*********************************************************************************
@@ -215,6 +241,7 @@ const _keyTypeExp = (type) => () => [
* Create expression that returns the key as an integer. Returns 'unknown' if
* the key is not an integer.
*
+ * @function
* @param {number} integer value Integer value of the key if the key is an integer.
* @return {AerospikeExp}
*/
@@ -224,6 +251,7 @@ exports.keyInt = _keyTypeExp(exp.type.INT)
* Create expression that returns the key as an string. Returns 'unknown' if
* the key is not a string.
*
+ * @function
* @param {string} string value String value of the key if the key is a string.
* @return {AerospikeExp}
*/
@@ -233,6 +261,7 @@ exports.keyStr = _keyTypeExp(exp.type.STR)
* Create expression that returns the key as an blob. Returns 'unknown' if
* the key is not an blob.
*
+ * @function
* @param {Object} blob Blob value of the key if the key is a blob.
* @return {AerospikeExp}
*/
@@ -243,6 +272,7 @@ exports.keyBlob = _keyTypeExp(exp.type.BLOB)
* data as a boolean expression. This would occur when "policy write key" is
* SEND on record write.
*
+ * @function
* @param {boolean} - value True if the record has a stored key, false otherwise.
* @return {AerospikeExp}
*/
@@ -264,6 +294,7 @@ const _binTypeExp = (type) => (binName) => [
* Create expression that returns a bin as a boolean value. Returns 'unknown'
* if the bin is not a boolean.
*
+ * @function
* @param {string }binName Bin name.
* @return {AerospikeExp} boolean bin
*/
@@ -273,6 +304,7 @@ exports.binBool = _binTypeExp(exp.type.BOOL)
* Create expression that returns a bin as a signed integer. Returns 'unknown'
* if the bin is not an integer.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} integer bin
*/
@@ -282,6 +314,7 @@ exports.binInt = _binTypeExp(exp.type.INT)
* Create expression that returns a bin as a float. Returns 'unknown' if the bin
* is not an float.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} float bin
*/
@@ -291,6 +324,7 @@ exports.binFloat = _binTypeExp(exp.type.FLOAT)
* Create expression that returns a bin as a string. Returns 'unknown' if the
* bin is not an string.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} string bin
*/
@@ -300,6 +334,7 @@ exports.binStr = _binTypeExp(exp.type.STR)
* Create expression that returns a bin as a blob. Returns 'unknown' if the bin
* is not an blob.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} blob bin
*/
@@ -309,6 +344,7 @@ exports.binBlob = _binTypeExp(exp.type.BLOB)
* Create expression that returns a bin as a geojson. Returns 'unknown' if the
* bin is not geojson.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} geojson bin
*/
@@ -318,6 +354,7 @@ exports.binGeo = _binTypeExp(exp.type.GEOJSON)
* Create expression that returns a bin as a list. Returns 'unknown' if the bin
* is not an list.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} list bin
*/
@@ -327,6 +364,7 @@ exports.binList = _binTypeExp(exp.type.LIST)
* Create expression that returns a bin as a map. Returns 'unknown' if the bin
* is not an map.
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} map bin
*/
@@ -336,6 +374,7 @@ exports.binMap = _binTypeExp(exp.type.MAP)
* Create expression that returns a bin as a HyperLogLog (hll). Returns
* 'unknown' if the bin is not a HyperLogLog (hll).
*
+ * @function
* @param {string} binName Bin name.
* @return {AerospikeExp} hll bin
*/
@@ -350,6 +389,7 @@ const _binType = exports.binType
/**
* Create expression that returns if bin of specified name exists.
*
+ * @function
* @param {string} binName Bin name.
* @return {boolean} - value True if the bin exists, false otherwise.
*/
@@ -365,6 +405,7 @@ const _metaExp = (op) => () => [{ op, count: 1 }]
* Create expression that returns record set name string. This expression usually
* evaluates quickly because record meta data is cached in memory.
*
+ * @function
* @return {AerospikeExp} string value Name of the set this record belongs to.
*/
exports.setName = _metaExp(exp.ops.SET_NAME)
@@ -374,6 +415,7 @@ exports.setName = _metaExp(exp.ops.SET_NAME)
* memory, then zero is returned. This expression usually evaluates quickly
* because record meta data is cached in memory.
*
+ * @function
* @return {AerospikeExp} integer value Uncompressed storage size of the record.
*/
exports.deviceSize = _metaExp(exp.ops.DEVICE_SIZE)
@@ -382,6 +424,7 @@ exports.deviceSize = _metaExp(exp.ops.DEVICE_SIZE)
* Create expression that returns record last update time expressed as 64 bit
* integer nanoseconds since 1970-01-01 epoch.
*
+ * @function
* @return {AerospikeExp} integer value When the record was last updated.
*/
exports.lastUpdate = _metaExp(exp.ops.LAST_UPDATE)
@@ -391,6 +434,7 @@ exports.lastUpdate = _metaExp(exp.ops.LAST_UPDATE)
* This expression usually evaluates quickly because record meta data is cached
* in memory.
*
+ * @function
* @return {AerospikeExp} integer value Number of milliseconds since last updated.
*/
exports.sinceUpdate = _metaExp(exp.ops.SINCE_UPDATE)
@@ -399,6 +443,7 @@ exports.sinceUpdate = _metaExp(exp.ops.SINCE_UPDATE)
* Create expression that returns record expiration time expressed as 64 bit
* integer nanoseconds since 1970-01-01 epoch.
*
+ * @function
* @return {AerospikeExp} integer value Expiration time in nanoseconds since 1970-01-01.
*/
exports.voidTime = _metaExp(exp.ops.VOID_TIME)
@@ -407,6 +452,7 @@ exports.voidTime = _metaExp(exp.ops.VOID_TIME)
* Create expression that returns record expiration time (time to live) in integer
* seconds.
*
+ * @function
* @return {AerospikeExp} integer value Number of seconds till the record will expire,
* returns -1 if the record never expires.
*/
@@ -417,6 +463,7 @@ exports.ttl = _metaExp(exp.ops.TTL)
* tombstone state. This expression usually evaluates quickly because record
* meta data is cached in memory.
*
+ * @function
* @return {AerospikeExp} - value True if the record is a tombstone, false otherwise.
*/
exports.isTombstone = _metaExp(exp.ops.IS_TOMBSTONE)
@@ -428,6 +475,7 @@ exports.isTombstone = _metaExp(exp.ops.IS_TOMBSTONE)
* in memory.
* Requires server version 5.3.0+.
*
+ * @function
* @return {AerospikeExp} integer value memory size of the record.
*/
exports.memorySize = _metaExp(exp.ops.MEMORY_SIZE)
@@ -435,6 +483,7 @@ exports.memorySize = _metaExp(exp.ops.MEMORY_SIZE)
/**
* Create expression that returns record digest modulo as integer.
*
+ * @function
* @param {number} mod Divisor used to divide the digest to get a remainder.
* @return {AerospikeExp} integer value Value in range 0 and mod (exclusive)..
*/
@@ -449,6 +498,7 @@ const _cmpExp = (op) => (left, right) => [{ op, count: 3 }].concat(left, right)
/**
* Create equals (==) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -458,6 +508,7 @@ exports.eq = _cmpExp(exp.ops.CMP_EQ)
/**
* Create not equal (!=) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -468,6 +519,7 @@ const _ne = exports.ne
/**
* Create a greater than (>) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -477,6 +529,7 @@ exports.gt = _cmpExp(exp.ops.CMP_GT)
/**
* Create a greater than or equals (>=) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -486,6 +539,7 @@ exports.ge = _cmpExp(exp.ops.CMP_GE)
/**
* Create a less than (<) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -495,6 +549,7 @@ exports.lt = _cmpExp(exp.ops.CMP_LT)
/**
* Create a less than or equals (<=) expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -505,6 +560,7 @@ exports.le = _cmpExp(exp.ops.CMP_LE)
* Create expression that performs a regex match on a string bin or value
* expression.
*
+ * @function
* @param {number} options POSIX regex flags defined in regex.h.
* @param {string} regex POSIX regex string.
* @param {AerospikeExp} cmpStr String expression to compare against.
@@ -520,6 +576,7 @@ exports.cmpRegex = (options, regex, cmpStr) => [
/**
* Create a point within region or region contains point expression.
*
+ * @function
* @param {number} left left expression in comparison.
* @param {number} right right expression in comparison.
* @return {AerospikeExp} - boolean value
@@ -533,6 +590,7 @@ exports.cmpGeo = _cmpExp(exp.ops.CMP_GEO)
/**
* Create "not" (!) operator expression.
*
+ * @function
* @param {AerospikeExp} expr Boolean expression to negate.
* @return {AerospikeExp} - boolean value
*/
@@ -550,6 +608,7 @@ const _VAExp = (op) => (...expr) => [].concat(
/**
* Create "and" (&&) operator that applies to a variable number of expressions.
*
+ * @function
* @param {AerospikeExp} ... Variable number of boolean expressions.
* @return {AerospikeExp} - boolean value
*/
@@ -558,6 +617,7 @@ exports.and = _VAExp(exp.ops.AND)
/**
* Create "or" (||) operator that applies to a variable number of expressions.
*
+ * @function
* @param {AerospikeExp} ... Variable number of boolean expressions.
* @return {AerospikeExp} - boolean value
*/
@@ -567,6 +627,7 @@ exports.or = _VAExp(exp.ops.OR)
* Create expression that returns true if only one of the expressions are true.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of boolean expressions.
* @return {AerospikeExp} - boolean value
*/
@@ -582,6 +643,7 @@ exports.exclusive = _VAExp(exp.ops.EXCLUSIVE)
* All arguments must be the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {number[]} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -594,6 +656,7 @@ exports.add = _VAExp(exp.ops.ADD)
* argument. All arguments must resolve to the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {number[]} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -605,6 +668,7 @@ exports.sub = _VAExp(exp.ops.SUB)
* that argument. All arguments must resolve to the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {number[]} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -617,6 +681,7 @@ exports.mul = _VAExp(exp.ops.MUL)
* All arguments must resolve to the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {number[]} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -632,6 +697,7 @@ const _paramsExp = (op) => (...params) => [
* All arguments must resolve to floats.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} base Base value.
* @param {number} exponent Exponent value.
* @return {AerospikeExp} float value
@@ -643,6 +709,7 @@ exports.pow = _paramsExp(exp.ops.POW)
* All arguments must resolve to floats.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} num Number.
* @param {number}base Base value.
* @return {AerospikeExp} float value
@@ -654,6 +721,7 @@ exports.log = _paramsExp(exp.ops.LOG)
* divided by "denominator". All arguments must resolve to integers.
* Requires server version 5.6.0+.
*
+ * @function
* @return {AerospikeExp} integer value
*/
exports.mod = _paramsExp(exp.ops.MOD)
@@ -663,6 +731,7 @@ exports.mod = _paramsExp(exp.ops.MOD)
* All arguments must resolve to integer or float.
* Requires server version 5.6.0+.
*
+ * @function
* @return {AerospikeExp} number value
*/
exports.abs = _paramsExp(exp.ops.ABS)
@@ -671,6 +740,7 @@ exports.abs = _paramsExp(exp.ops.ABS)
* Create expression that rounds a floating point number down to the closest integer value.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} num Floating point value to round down.
* @return {AerospikeExp} float-value
*/
@@ -680,6 +750,7 @@ exports.floor = _paramsExp(exp.ops.FLOOR)
* Create expression that rounds a floating point number up to the closest integer value.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} num Floating point value to round up.
* @return {AerospikeExp} integer-value
*/
@@ -689,6 +760,7 @@ exports.ceil = _paramsExp(exp.ops.CEIL)
* Create expression that converts a float to an integer.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} num Integer to convert to a float
* @return {AerospikeExp} float value
*/
@@ -698,6 +770,7 @@ exports.toInt = _paramsExp(exp.ops.TO_INT)
* Create expression that converts an integer to a float.
* Requires server version 5.6.0+.
*
+ * @function
* @param {number} num Integer to convert to a float
* @return {AerospikeExp} float value
*/
@@ -708,6 +781,7 @@ exports.toFloat = _paramsExp(exp.ops.TO_FLOAT)
* All arguments must resolve to integers.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of integer expressions.
* @return {AerospikeExp} integer value
*/
@@ -718,6 +792,7 @@ exports.intAnd = _VAExp(exp.ops.INT_AND)
* All arguments must resolve to integers.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of integer expressions.
* @return {AerospikeExp} integer value
*/
@@ -728,6 +803,7 @@ exports.intOr = _VAExp(exp.ops.INT_OR)
* All arguments must resolve to integers.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of integer expressions.
* @return {AerospikeExp} integer value
*/
@@ -737,6 +813,7 @@ exports.intXor = _VAExp(exp.ops.INT_XOR)
* Create integer "not" (~) operator.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} expr Integer expression.
* @return {AerospikeExp} integer value
*/
@@ -746,6 +823,7 @@ exports.intNot = _paramsExp(exp.ops.INT_NOT)
* Create integer "left shift" (<<) operator.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} value Integer expression.
* @param {number} shift Number of bits to shift by.
* @return {AerospikeExp} integer value
@@ -756,6 +834,7 @@ exports.intLshift = _paramsExp(exp.ops.INT_LSHIFT)
* Create integer "logical right shift" (>>>) operator.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} value Integer expression.
* @param {number} shift Number of bits to shift by.
* @return {AerospikeExp} integer value
@@ -766,6 +845,7 @@ exports.intRshift = _paramsExp(exp.ops.INT_RSHIFT)
* Create integer "arithmetic right shift" (>>) operator.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} value Integer expression.
* @param {number} shift Number of bits to shift by.
* @return {AerospikeExp} integer value
@@ -776,6 +856,7 @@ exports.intArshift = _paramsExp(exp.ops.INT_ARSHIFT)
* Create expression that returns count of integer bits that are set to 1.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp}
* @return {AerospikeExp} integer value
*/
@@ -789,6 +870,7 @@ exports.intCount = _paramsExp(exp.ops.INT_COUNT)
* value 1. If "search" is false it will search for bit value 0.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp}
* @return {AerospikeExp} integer value
*/
@@ -802,6 +884,7 @@ exports.intLscan = _paramsExp(exp.ops.INT_LSCAN)
* value 1. If "search" is false it will search for bit value 0.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp}
* @return {AerospikeExp} integer value
*/
@@ -812,6 +895,7 @@ exports.intRscan = _paramsExp(exp.ops.INT_RSCAN)
* All arguments must be the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -822,6 +906,7 @@ exports.min = _VAExp(exp.ops.MIN)
* All arguments must be the same type (integer or float).
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of integer or float expressions.
* @return {AerospikeExp} integer or float value
*/
@@ -834,6 +919,7 @@ exports.max = _VAExp(exp.ops.MAX)
* Conditionally select an expression from a variable number of expression pairs
* followed by default expression action. Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp}
* @return {AerospikeExp} first action expression where bool expression is true or action-default.
*/
@@ -843,6 +929,7 @@ exports.cond = _VAExp(exp.ops.COND)
* Define variables and expressions in scope.
* Requires server version 5.6.0+.
*
+ * @function
* @param {AerospikeExp} ... Variable number of expression def followed by a scoped
* expression.
* @return {AerospikeExp} result of scoped expression.
@@ -853,6 +940,7 @@ exports.let = _VAExp(exp.ops.LET)
* Assign variable to an expression that can be accessed later.
* Requires server version 5.6.0+.
*
+ * @function
* @param {string} varName Variable name.
* @param {AerospikeExp} expr The variable is set to the result of expr.
* @return {AerospikeExp} A variable name expression pair.
@@ -866,6 +954,7 @@ exports.def = (varName, expr) => [
* Retrieve expression value from a variable.
* Requires server version 5.6.0+.
*
+ * @function
* @param {string} varName Variable name.
* @return {AerospikeExp} value stored in variable.
*/
diff --git a/lib/exp_bit.js b/lib/exp_bit.js
index 9bc3fd04..55fd93be 100644
--- a/lib/exp_bit.js
+++ b/lib/exp_bit.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/exp_hll.js b/lib/exp_hll.js
index 0e527580..70c3c6a3 100644
--- a/lib/exp_hll.js
+++ b/lib/exp_hll.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2021-2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/exp_lists.js b/lib/exp_lists.js
index 6873aa02..94bc7b5c 100644
--- a/lib/exp_lists.js
+++ b/lib/exp_lists.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2021-2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/exp_operations.js b/lib/exp_operations.js
index 10db3230..5ab142db 100644
--- a/lib/exp_operations.js
+++ b/lib/exp_operations.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/features.js b/lib/features.js
index b965cec7..c4eaa2ab 100644
--- a/lib/features.js
+++ b/lib/features.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2019 Aerospike, Inc.
+// Copyright 2019-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.
diff --git a/lib/filter.js b/lib/filter.js
index 171aaa7e..9152ca94 100644
--- a/lib/filter.js
+++ b/lib/filter.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/geojson.js b/lib/geojson.js
index 1bf075ab..bf329ab6 100644
--- a/lib/geojson.js
+++ b/lib/geojson.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/hll.js b/lib/hll.js
index 3fb3d895..10bb3a22 100644
--- a/lib/hll.js
+++ b/lib/hll.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2020 Aerospike, Inc.
+// Copyright 2020-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.
diff --git a/lib/index_job.js b/lib/index_job.js
index 41325bd5..b782d144 100644
--- a/lib/index_job.js
+++ b/lib/index_job.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/info.js b/lib/info.js
index 84efcf60..c46ef258 100644
--- a/lib/info.js
+++ b/lib/info.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/job.js b/lib/job.js
index a0f0e041..2b579112 100644
--- a/lib/job.js
+++ b/lib/job.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/key.js b/lib/key.js
index b0a32b57..db4d35bd 100644
--- a/lib/key.js
+++ b/lib/key.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/lists.js b/lib/lists.js
index 7c573c32..35b02019 100644
--- a/lib/lists.js
+++ b/lib/lists.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/maps.js b/lib/maps.js
index 84ae9a4d..0b9c4098 100644
--- a/lib/maps.js
+++ b/lib/maps.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/apply_policy.js b/lib/policies/apply_policy.js
index ddbb3855..cfa58266 100644
--- a/lib/policies/apply_policy.js
+++ b/lib/policies/apply_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/base_policy.js b/lib/policies/base_policy.js
index 953e92bd..19d3ae48 100644
--- a/lib/policies/base_policy.js
+++ b/lib/policies/base_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/batch_apply_policy.js b/lib/policies/batch_apply_policy.js
index f61635c2..92335c4b 100644
--- a/lib/policies/batch_apply_policy.js
+++ b/lib/policies/batch_apply_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/policies/batch_policy.js b/lib/policies/batch_policy.js
index ac231dbb..245812db 100644
--- a/lib/policies/batch_policy.js
+++ b/lib/policies/batch_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/batch_read_policy.js b/lib/policies/batch_read_policy.js
index 2b83680c..21225d9c 100644
--- a/lib/policies/batch_read_policy.js
+++ b/lib/policies/batch_read_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/policies/batch_remove_policy.js b/lib/policies/batch_remove_policy.js
index 406762ca..7a683424 100644
--- a/lib/policies/batch_remove_policy.js
+++ b/lib/policies/batch_remove_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/policies/batch_write_policy.js b/lib/policies/batch_write_policy.js
index f049c0d3..7bd43f6e 100644
--- a/lib/policies/batch_write_policy.js
+++ b/lib/policies/batch_write_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2022 Aerospike, Inc.
+// Copyright 2022-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.
diff --git a/lib/policies/bitwise_policy.js b/lib/policies/bitwise_policy.js
index ec3c87dc..94e73187 100644
--- a/lib/policies/bitwise_policy.js
+++ b/lib/policies/bitwise_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2019 Aerospike, Inc.
+// Copyright 2019-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.
diff --git a/lib/policies/command_queue_policy.js b/lib/policies/command_queue_policy.js
index a1a2d42b..4662afc7 100644
--- a/lib/policies/command_queue_policy.js
+++ b/lib/policies/command_queue_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2018 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/hll_policy.js b/lib/policies/hll_policy.js
index f02ee2eb..c3d00c97 100644
--- a/lib/policies/hll_policy.js
+++ b/lib/policies/hll_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2020 Aerospike, Inc.
+// Copyright 2020-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.
diff --git a/lib/policies/info_policy.js b/lib/policies/info_policy.js
index dec2bfc8..339ee99c 100644
--- a/lib/policies/info_policy.js
+++ b/lib/policies/info_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/list_policy.js b/lib/policies/list_policy.js
index 35c07bb7..d5c11bac 100644
--- a/lib/policies/list_policy.js
+++ b/lib/policies/list_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2018 Aerospike, Inc.
+// Copyright 2018-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.
diff --git a/lib/policies/map_policy.js b/lib/policies/map_policy.js
index 51ad2005..cd195127 100644
--- a/lib/policies/map_policy.js
+++ b/lib/policies/map_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/operate_policy.js b/lib/policies/operate_policy.js
index 124cae6b..611c28c5 100644
--- a/lib/policies/operate_policy.js
+++ b/lib/policies/operate_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/query_policy.js b/lib/policies/query_policy.js
index 7622a403..1e6f0d86 100644
--- a/lib/policies/query_policy.js
+++ b/lib/policies/query_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/read_policy.js b/lib/policies/read_policy.js
index f0c5e9a6..5241cd15 100644
--- a/lib/policies/read_policy.js
+++ b/lib/policies/read_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2019 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/remove_policy.js b/lib/policies/remove_policy.js
index 753dbc96..6f694858 100644
--- a/lib/policies/remove_policy.js
+++ b/lib/policies/remove_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/scan_policy.js b/lib/policies/scan_policy.js
index bd880c9d..ee8f03bf 100644
--- a/lib/policies/scan_policy.js
+++ b/lib/policies/scan_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policies/write_policy.js b/lib/policies/write_policy.js
index 433d5198..e3d3d387 100644
--- a/lib/policies/write_policy.js
+++ b/lib/policies/write_policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/policy.js b/lib/policy.js
index eddd3660..6b9b834c 100644
--- a/lib/policy.js
+++ b/lib/policy.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2022 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/query.js b/lib/query.js
index 0f475ee7..e8b047a2 100644
--- a/lib/query.js
+++ b/lib/query.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2020 Aerospike, Inc.
+// Copyright 2013-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.
@@ -54,17 +54,21 @@ const util = require('util')
* module:aerospike/filter.geoContainsGeoJSONPoint} against geo indexes
*
* See {@link module:aerospike/filter} for a list of all supported secondary
- * index filter predicates.
+ * index filter.
*
- * Before a filter predicate can be applied, a SI needs to be
- * created on the bins which the predicate matches on. Using the Node.js
+ * Before a secondary index filter can be applied, a SI needs to be
+ * created on the bins which the index filter matches on. Using the Node.js
* client, a SI can be created using {@link Client#createIndex}.
*
- * Currently, only a single SI filter predicate is supported for
+ * Currently, only a single SI index filter is supported for
* each query. To do more advanced filtering, a expressions can be
* applied to the query using policy (see below). Alternatively, User-Defined Functions
* (UDFs) can be used to further process the query results on the server.
*
+ * Previously, predicate filtering was used to perform secondary index queries.
+ * SI filter predicates have been deprecated since server 5.2, and obsolete since
+ * server 6.0.
+ *
* For more information about Predicate Filtering, please refer to the ⇑Predicate
* Filtering documentation in the Aerospike Feature Guide.
@@ -121,11 +125,29 @@ const util = require('util')
* ⇑Record UDFs
* in the Aerospike technical documentation.
*
+ * #### Query pagination
+ *
+ * Query pagination allows for queries return records in pages rather than all at once.
+ * To enable query pagination, the query property {@link Query#paginate} must be true
+ * and the previously stated query property {@link Query#maxRecords} must be set to a
+ * nonzero positive integer in order to specify a maximum page size.
+ *
+ * When a page is complete, {@link RecordStream} event {@link RecordStream#event:error} will
+ * emit a {@link Query#queryState} object containing a serialized version of the query.
+ * This serialized query, if be assigned back to {@link Query#queryState}, allows the query
+ * to retrieve the next page of records in the query upon calling {@link Query#foreach}.
+ * If {@link Query#queryState} is undefined, pagination is not enabled or the query has completed.
+ * If {@link RecordStream#event:error} emits an undefined object, either {@link Query#paginate}
+ * is not true, or the query has successfully returned all the specified records.
+ *
+ * For additional information and examples, please refer to the {@link Query#paginate} section
+ * below.
+ *
* @param {Client} client - A client instance.
* @param {string} ns - The namescape.
* @param {string} set - The name of a set.
* @param {object} [options] - Query parameters.
- * @param {object[]} [options.filters] - List of filter predicates to
+ * @param {object[]} [options.filters] - List of index filters to
* apply to the query. See {@link Query#where}.
* @param {string[]} [options.select] - List of bin names to select. See
* {@link Query#select}.
@@ -199,13 +221,13 @@ function Query (client, ns, set, options) {
/**
* Filters to apply to the query.
*
- * *Note:* Currently, a single filter predicate is supported. To do more
+ * *Note:* Currently, a single index filter is supported. To do more
* advanced filtering, you need to use a user-defined function (UDF) to
* process the result set on the server.
*
* @member {object[]} Query#filters
*
- * @see Use {@link Query#where} to add filter predicates to the query.
+ * @see Use {@link Query#where} to add index filters to the query.
* @see Use {@link module:aerospike/filter} to create a SI
* filter.
*/
@@ -239,12 +261,167 @@ function Query (client, ns, set, options) {
this.udf = options.udf
/**
- * If set to true, the scan will return only those belongs to partitions.
+ * If set to true, the query will return records belonging to the partitions specified
+ * in {@link Query#partFilter}.
*
* @member {boolean} Query#pfEnabled
* @private
*/
this.pfEnabled = false
+
+ /**
+ * If set to true, paginated queries are enabled. In order to receive paginated
+ * results, the {@link query#maxRecords} property must assign a nonzero integer value.
+ *
+ * @member {boolean} Query#paginate
+ *
+ * @example
Asynchronous pagination over a set of thirty records with {@link Query#foreach}.
Asynchronous pagination over a set of thirty records with {@link Query#results}
+ *
+ *
+ * const Aerospike = require('./lib/aerospike');
+ * // Define host configuration
+ * let config = {
+ * hosts: '34.213.88.142:3000',
+ * policies: {
+ * batchWrite : new Aerospike.BatchWritePolicy({socketTimeout : 0, totalTimeout : 0}),
+ * }
+ * };
+ *
+ * var batchRecords = []
+ * for(let i = 0; i < 30; i++){
+ * batchRecords.push({
+ * type: Aerospike.batchType.BATCH_WRITE,
+ * key: new Aerospike.Key('test', 'demo', 'key' + i),
+ * ops:[Aerospike.operations.write('exampleBin', i)]
+ * })
+ * }
+ *
+ *
+ * ;(async function() {
+ * try {
+ * client = await Aerospike.connect(config)
+ * await client.truncate('test', 'demo', 0)
+ * await client.batchWrite(batchRecords, {socketTimeout : 0, totalTimeout : 0})
+ *
+ * const query = client.query('test', 'demo', { paginate: true, maxRecords: 11})
+ *
+ * let allResults = []
+ * let results = await query.results()
+ * allResults = [...allResults, ...results]
+ *
+ *
+ * results = await query.results()
+ * allResults = [...allResults, ...results]
+ *
+ * results = await query.results()
+ * allResults = [...allResults, ...results]
+ *
+ * console.log("Records returned in total: " + allResults.length) // Should be 30 records
+ * } catch (error) {
+ * console.error('An error occurred at some point.', error)
+ * process.exit(1)
+ * } finally {
+ * if (client) client.close()
+ * }
+ * })()
+ *
+ */
+ this.paginate = options.paginate
+
+ /**
+ * Approximate number of records to return to client.
+ *
+ * When {@link query#paginate} is true,
+ * then maxRecords will be the page size if there are enough records remaining in the query to fill the page size.
+ *
+ * When {@link query#paginate} is false, this number is divided by the number of nodes involved in the scan,
+ * and actual number of records returned may be less than maxRecords if node record counts are small and unbalanced across nodes.
+ * @member {number} Query#maxRecords
+ */
+ this.maxRecords = options.maxRecords
+
+ /**
+ * If set to a valid serialized query, calling {@link query#foreach} will allow the next page of records to be queried while preserving the progress
+ * of the previous query. If set to null, calling {@link query#foreach} will begin a new query.
+ * @member {number} Query#queryState
+ */
+ this.queryState = undefined
+}
+
+/**
+ * @function Query#nextPage
+ *
+ * @summary Sets {@link query#queryState} to the value specified by the state argument.
+ *
+ * @description setter function for the {@link Query#queryState} member variable.
+ *
+ * @param {...object} state - serialized query emitted from the {@link RecordStream#event:error} event.
+ */
+Query.prototype.nextPage = function (state) {
+ this.queryState = state
+}
+
+/**
+ * @function Query#hasNextPage
+ *
+ * @summary Checks compiliation status of a paginated query.
+ *
+ * @description If false is returned, there are no more records left in the query, and the query is complete.
+ * If true is returned, calling {@link Query#foreach} will continue from the state specified by {@link Query#queryState}.
+ *
+ * @returns {boolean}
+ */
+Query.prototype.hasNextPage = function () {
+ return (!!this.queryState)
}
/**
@@ -275,7 +452,7 @@ Query.prototype.select = function (bins) {
* This method takes SI created using the {@link
* module:aerospike/filter|filter module} as argument.
*
- * @param {module:aerospike/filter~SindexFilterPredicate} predicate - The filter to
+ * @param {module:aerospike/filter~SindexFilterPredicate} index filter - The index filter to
* apply to the function.
*
* @example
Applying a SI filter to find all records
@@ -311,11 +488,11 @@ Query.prototype.select = function (bins) {
* stream.on('end', () => client.close())
* })
*/
-Query.prototype.where = function (predicate) {
- if (predicate instanceof filter.SindexFilterPredicate) {
- this.setSindexFilter(predicate)
+Query.prototype.where = function (indexFilter) {
+ if (indexFilter instanceof filter.SindexFilterPredicate) {
+ this.setSindexFilter(indexFilter)
} else {
- throw new TypeError('predicate should be a SindexFilterPredicate')
+ throw new TypeError('indexFilter should be a SindexFilterPredicate')
}
}
@@ -345,15 +522,15 @@ Query.prototype.setUdf = function (udfModule, udfFunction, udfArgs) {
* @function Query#partitions
*
* @summary Specify the begin and count of the partitions
- * to be scanned by the Query foreach op.
+ * to be queried by the Query foreach op.
*
* @description If a Query specifies partitions begin and count,
- * then only those partitons will be scanned and returned.
+ * then only those partitons will be queried and returned.
* If no partitions are specified,
- * then all partitions will be scanned and returned.
+ * then all partitions will be queried and returned.
*
- * @param {number} begin - Start partition number to scan.
- * @param {number} count - Number of partitions from the start to scan.
+ * @param {number} begin - Start partition number to query.
+ * @param {number} count - Number of partitions from the start to query.
* @param {string} digest - Start from this digest if it is specified.
*/
Query.prototype.partitions = function (begin, count, digest) {
@@ -400,26 +577,43 @@ Query.prototype.foreach = function (policy, dataCb, errorCb, endCb) {
const args = [this.ns, this.set, this, policy]
let cmd
if (this.udf) {
- cmd = new Commands.QueryForeach(stream, args)
+ if (this.paginate) {
+ throw new Error('Stream UDF cannot be applied using a paginated stream. Please disable pagination or UDF.')
+ } else {
+ cmd = new Commands.QueryForeach(stream, args)
+ }
} else {
- cmd = new Commands.Query(stream, args)
+ if (this.paginate) {
+ args.push(this.queryState)
+ args.push(this.maxRecords)
+ cmd = new Commands.QueryPages(stream, args)
+ } else {
+ cmd = new Commands.Query(stream, args)
+ }
}
+ cmd.queryState = this.queryState
cmd.execute()
-
return stream
}
/**
* @function Query#results
*
- * @summary Executes the query and collects the results into an array.
+ * @summary Executes the query and collects the results into an array. On paginated queries,
+ * preparing the next page is also handled automatically.
*
+ * *
* @description This method returns a Promise that contains the query results
* as an array of records, when fulfilled. It should only be used if the query
* is expected to return only few records; otherwise it is recommended to use
* {@link Query#foreach}, which returns the results as a {@link RecordStream}
* instead.
*
+ * If pagination is enabled, the data emitted from the {@link RecordStream#event:error}
+ * event will automatically be assigned to {@link Query#queryState}, allowing the next page
+ * of records to be queried if {@link Query#foreach} or {@link Query#results} is called.
+ *
+ *
* @param {QueryPolicy} [policy] - The Query Policy to use for this operation.
*
* @returns {Promise}
@@ -429,8 +623,11 @@ Query.prototype.results = function (policy) {
const stream = this.foreach(policy)
const results = []
stream.on('error', reject)
- stream.on('end', () => resolve(results))
stream.on('data', record => results.push(record))
+ stream.on('end', (queryState) => {
+ this.queryState = queryState
+ resolve(results)
+ })
})
}
diff --git a/lib/record.js b/lib/record.js
index 5bec0007..16dc302f 100644
--- a/lib/record.js
+++ b/lib/record.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/record_stream.js b/lib/record_stream.js
index 5649d456..865910c2 100644
--- a/lib/record_stream.js
+++ b/lib/record_stream.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2017 Aerospike, Inc.
+// Copyright 2013-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.
diff --git a/lib/scan.js b/lib/scan.js
index e311e607..5a8c6d49 100644
--- a/lib/scan.js
+++ b/lib/scan.js
@@ -1,5 +1,5 @@
// *****************************************************************************
-// Copyright 2013-2021 Aerospike, Inc.
+// Copyright 2013-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.
@@ -30,9 +30,10 @@ const RecordStream = require('./record_stream')
* Scans can return a set of records as a {@link RecordStream} or apply an
* Aerospike UDF (user-defined function) on each of the records on the server.
*
- * Scan is depricated in server 6.0. Use Query methods implemented by {@link Client#query}
+ * #### Scan is obsolete in server 6.0
+ * Use query methods implemented by {@link Client#query}.
* For more information, please refer to the section on
- * ⇑Scans
+ * ⇑Historical evolution of scan features
* in the Aerospike technical documentation.
*
* #### Selecting Bins
@@ -61,6 +62,23 @@ const RecordStream = require('./record_stream')
* ⇑Record UDFs
* in the Aerospike technical documentation.
*
+ * #### Scan pagination
+ *
+ * Scan pagination allows for queries return records in pages rather than all at once.
+ * To enable scan pagination, the scan property {@link Scan#paginate} must be true
+ * and the previously stated scan policy {@link ScanPolicy#maxRecords} must be set to a
+ * nonzero positive integer in order to specify a maximum page size.
+ *
+ * When a page is complete, {@link RecordStream} event {@link RecordStream#event:error} will
+ * emit a {@link Scan#scanState} object containing a serialized version of the scan.
+ * This serialized scan, if be assigned back to {@link Scan#scanState}, allows the scan
+ * to retrieve the next page of records in the scan upon calling {@link Scan#foreach}.
+ * If {@link RecordStream#event:error} emits an undefined object, either {@link Scan#paginate}
+ * is not true, or the scan has successfully returned all the specified records.
+ *
+ * For additional information and examples, please refer to the {@link Scan#paginate} section
+ * below.
+ *
* @param {Client} client - A client instance.
* @param {string} ns - The namescape.
* @param {string} set - The name of a set.
@@ -157,8 +175,147 @@ function Scan (client, ns, set, options) {
* @private
*/
this.pfEnabled = false
+ /**
+ * If set to true, paginated queries are enabled. In order to receive paginated
+ * results, the {@link ScanPolicy#maxRecords} property must assign a nonzero integer value.
+ *
+ * @member {boolean} Scan#paginate
+ *
+ * @example
Asynchronous pagination over a set of thirty records with {@link Scan#foreach}.