# Node.js Client

**URL:** https://discuss.aerospike.com/c/client-libraries/node-js-client/13.md

[Latest](https://discuss.aerospike.com/latest.md) · [Categories](https://discuss.aerospike.com/categories.md) · [Tags](https://discuss.aerospike.com/tags.md)

---

## [About the Node.js Client category](https://discuss.aerospike.com/t/about-the-node-js-client-category/35)

<div class="topic-metadata">

**Author:** [@kporter](https://discuss.aerospike.com/u/kporter)\
**Replies:** 0

</div>

Discuss the Node.js client

---

## [How to set keys ttl while executing batchWrite?](https://discuss.aerospike.com/t/how-to-set-keys-ttl-while-executing-batchwrite/10790)

<div class="topic-metadata">

**Author:** [@Konstantin\_Andreev](https://discuss.aerospike.com/u/Konstantin_Andreev)\
**Replies:** 2\
**Last updated:** [June 28, 2024, 9:30am UTC](https://discuss.aerospike.com/t/how-to-set-keys-ttl-while-executing-batchwrite/10790 "2024-06-28T09:30:54Z")

</div>

Hello! Is there any possibility to set per key TTL in batchWrite? I came to the following code, but it doesn’t work for not existent keys. const policy = new Aerospike.BatchWritePolicy({ exists: Aer…

---

## [Unable to find record by regexp pattern](https://discuss.aerospike.com/t/unable-to-find-record-by-regexp-pattern/11255)

<div class="topic-metadata">

**Author:** [@IvanR](https://discuss.aerospike.com/u/IvanR)\
**Replies:** 0\
**Last updated:** [June 28, 2024, 9:03am UTC](https://discuss.aerospike.com/t/unable-to-find-record-by-regexp-pattern/11255 "2024-06-28T09:03:34Z")

</div>

I need to find a record by RegExp pattern of one of its bins. But to be honest i am getting all existing results in set instead of matched. Reproducable result is here: const Aerospike = require('aerospike'); const clie…

---

## [Unable to get a record by filter 'contains' if bin array includes \> 1 element](https://discuss.aerospike.com/t/unable-to-get-a-record-by-filter-contains-if-bin-array-includes-1-element/11254)

<div class="topic-metadata">

**Author:** [@IvanR](https://discuss.aerospike.com/u/IvanR)\
**Replies:** 0\
**Last updated:** [June 28, 2024, 8:57am UTC](https://discuss.aerospike.com/t/unable-to-get-a-record-by-filter-contains-if-bin-array-includes-1-element/11254 "2024-06-28T08:57:09Z")

</div>

Hello! I encountered an unusual issue. I’m not sure if it’s a bug or if I’m mistaken, but I would appreciate some clarification :slight\_smile: So the summary is: while trying to search across the indexed array bin, If th…

---

## [When operation timeout period starts](https://discuss.aerospike.com/t/when-operation-timeout-period-starts/10897)

<div class="topic-metadata">

**Author:** [@Bvv](https://discuss.aerospike.com/u/Bvv)\
**Replies:** 2\
**Last updated:** [March 26, 2024, 8:35am UTC](https://discuss.aerospike.com/t/when-operation-timeout-period-starts/10897 "2024-03-26T08:35:19Z")

</div>

It seems that the client starts timeout period not right before performing an operation. Is it expected and documented somewhere? Repo to reproduce:

---

## [How do I install Aerospike node.js client on Windows?](https://discuss.aerospike.com/t/how-do-i-install-aerospike-node-js-client-on-windows/9951)

<div class="topic-metadata">

**Author:** [@Ankur\_Pandey](https://discuss.aerospike.com/u/Ankur_Pandey)\
**Replies:** 2\
**Last updated:** [February 21, 2024, 2:34pm UTC](https://discuss.aerospike.com/t/how-do-i-install-aerospike-node-js-client-on-windows/9951 "2024-02-21T14:34:00Z")

</div>

Is there any way of using Aerospike node.js client on Windows other than using virtualbox to install ubuntu and then use Aerospike node.js client inside it?

---

## [Jest: sequentially run tests are failed](https://discuss.aerospike.com/t/jest-sequentially-run-tests-are-failed/10307)

<div class="topic-metadata">

**Author:** [@Bvv](https://discuss.aerospike.com/u/Bvv)\
**Replies:** 8\
**Last updated:** [January 29, 2024, 5:00pm UTC](https://discuss.aerospike.com/t/jest-sequentially-run-tests-are-failed/10307 "2024-01-29T17:00:19Z")

</div>

Does anybody know what is the reason of failing test that are run sequentially ( with runInBand flag). The error message is “Unable to register default event loop: Failed to add external loop. Capacity is 1 \[-1\]”. Is the…

---

## [Why insert/put within loop insert only 1 row?](https://discuss.aerospike.com/t/why-insert-put-within-loop-insert-only-1-row/9507)

<div class="topic-metadata">

**Author:** [@James\_Basumatary](https://discuss.aerospike.com/u/James_Basumatary)\
**Replies:** 6\
**Last updated:** [August 1, 2022, 11:49pm UTC](https://discuss.aerospike.com/t/why-insert-put-within-loop-insert-only-1-row/9507 "2022-08-01T23:49:43Z")

</div>

I have been trying to put data of about 100 rows in foreach loop in node js… Unfortunately I didn’t find any solution… It just insert 1 row and, print error message: AerospikeError: Client timeout: iterations=1 lastNode…

---

## [Node.js client upgrade from 1.0 to 3.5](https://discuss.aerospike.com/t/node-js-client-upgrade-from-1-0-to-3-5/5450)

<div class="topic-metadata">

**Author:** [@rdaero](https://discuss.aerospike.com/u/rdaero)\
**Replies:** 6\
**Last updated:** [August 21, 2018, 3:26am UTC](https://discuss.aerospike.com/t/node-js-client-upgrade-from-1-0-to-3-5/5450 "2018-08-21T03:26:50Z")

</div>

Hi, We are currently running a 3 node Aerospike cluster (v3.8.4). We hit the cluster with a fairly high volume of traffic from around 30 Node (v5.5) instances which are running version 1.0 of the Node Aerospike client. …

---

## [Suggestion for filtering based on multiple predicate](https://discuss.aerospike.com/t/suggestion-for-filtering-based-on-multiple-predicate/8344)

<div class="topic-metadata">

**Author:** [@Aditya\_Gupta](https://discuss.aerospike.com/u/Aditya_Gupta)\
**Replies:** 3\
**Last updated:** [April 14, 2021, 1:27pm UTC](https://discuss.aerospike.com/t/suggestion-for-filtering-based-on-multiple-predicate/8344 "2021-04-14T13:27:44Z")

</div>

I have been through several forum discussions and found that there is limited support for querying Aerospike with multiple predicates. One solution is to use UDFs to further filter out the resuts. Like in this post. I …

---

## [Right way to insert data asynchronously](https://discuss.aerospike.com/t/right-way-to-insert-data-asynchronously/8311)

<div class="topic-metadata">

**Author:** [@Aditya\_Gupta](https://discuss.aerospike.com/u/Aditya_Gupta)\
**Replies:** 7\
**Last updated:** [March 30, 2021, 4:48am UTC](https://discuss.aerospike.com/t/right-way-to-insert-data-asynchronously/8311 "2021-03-30T04:48:12Z")

</div>

I am trying to insert 20,000 records using: aerospikeClient.put(new Aerospike.Key(‘test’, ‘my-set’, key), packet, {}, policy) .catch(error =\> console.log(error)); This piece of code is called 20,000 times. But due to d…

---

## [Background job reports "done(ok)" while some records failed](https://discuss.aerospike.com/t/background-job-reports-done-ok-while-some-records-failed/8166)

<div class="topic-metadata">

**Author:** [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Replies:** 7\
**Last updated:** [January 20, 2021, 11:01am UTC](https://discuss.aerospike.com/t/background-job-reports-done-ok-while-some-records-failed/8166 "2021-01-20T11:01:50Z")

</div>

During the execution of a background UDF job, we had the following errors in our server log. Jan 18 2021 13:26:28 GMT: DEBUG (socket): (socket.c:1044) Error while sending on FD 127: 11 (Resource temporarily unavailable)…

---

## [Moving from NodeJs from 0.12 to 8.9.3 - UDF issue](https://discuss.aerospike.com/t/moving-from-nodejs-from-0-12-to-8-9-3-udf-issue/5067)

<div class="topic-metadata">

**Author:** [@manikmi](https://discuss.aerospike.com/u/manikmi)\
**Replies:** 33\
**Last updated:** [November 25, 2020, 1:37am UTC](https://discuss.aerospike.com/t/moving-from-nodejs-from-0-12-to-8-9-3-udf-issue/5067 "2020-11-25T01:37:26Z")

</div>

Hi, We are using Aerospike for our project and using the Node J client. We are using a UDF for our purpose. We are using the old version of Nodejs and aerospike. Now we are moving to newer versions. Below are the versi…

---

## [Connecting to Aerospike NodeJs client](https://discuss.aerospike.com/t/connecting-to-aerospike-nodejs-client/7614)

<div class="topic-metadata">

**Author:** [@bogdan-pistol](https://discuss.aerospike.com/u/bogdan-pistol)\
**Replies:** 3\
**Last updated:** [July 8, 2020, 8:27am UTC](https://discuss.aerospike.com/t/connecting-to-aerospike-nodejs-client/7614 "2020-07-08T08:27:47Z")

</div>

I am trying to connect to the cluster like in the tutorial: https://www.aerospike.com/apidocs/nodejs/tutorial-node\_clusters.html client.connect((err) =\> { if (err) throw err }) http.createServer((req, res) =\> { d…

---

## [NodeJS Client On docker node image](https://discuss.aerospike.com/t/nodejs-client-on-docker-node-image/7143)

<div class="topic-metadata">

**Author:** [@Nel\_Taurisson](https://discuss.aerospike.com/u/Nel_Taurisson)\
**Replies:** 1\
**Last updated:** [February 28, 2020, 2:31am UTC](https://discuss.aerospike.com/t/nodejs-client-on-docker-node-image/7143 "2020-02-28T02:31:10Z")

</div>

Hello, I’m struggling to get the client installed on any tag of the Docker Hub official image. I tried with node:10-stretch but kept having “Error: libssl.so.1.0.0: cannot open shared object file” at runtime, but didn’…

---

## [Installing Aerospike client for nodejs](https://discuss.aerospike.com/t/installing-aerospike-client-for-nodejs/3570)

<div class="topic-metadata">

**Author:** [@kitex](https://discuss.aerospike.com/u/kitex)\
**Replies:** 10\
**Last updated:** [January 1, 2020, 12:35pm UTC](https://discuss.aerospike.com/t/installing-aerospike-client-for-nodejs/3570 "2020-01-01T12:35:09Z")

</div>

I have been trying to install aerospike client for nodejs on ubuntu. I have tried with nodejs 5/6/7 with ubuntu 12 and 16 Install nodejs: curl -sL https://deb.nodesource.com/setup\_6.x | sudo -E bash - sudo apt-get in…

---

## [CRUD List contained in a map](https://discuss.aerospike.com/t/crud-list-contained-in-a-map/6886)

<div class="topic-metadata">

**Author:** [@xfankit](https://discuss.aerospike.com/u/xfankit)\
**Replies:** 3\
**Last updated:** [December 6, 2019, 7:47am UTC](https://discuss.aerospike.com/t/crud-list-contained-in-a-map/6886 "2019-12-06T07:47:42Z")

</div>

I have a data structure something like this : { id : address : \[ { id : }, { id : } \] } So how can i achieve this in aerospike. Should i use the List data structure or and suggestion regarding this. Thank you.

---

## [Build Error within aerospike-client-c-src-4.6.8](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820)

<div class="topic-metadata">

**Author:** [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Replies:** 4\
**Last updated:** [November 27, 2019, 11:22am UTC](https://discuss.aerospike.com/t/build-error-within-aerospike-client-c-src-4-6-8/6820 "2019-11-27T11:22:07Z")

</div>

I’m trying to put the Aerospike Node.js client into an alpine Docker container. This needs some building the client-c-src. The actual build process is split up into 3 different stages. Stage 1: Build Aerospike C client…

---

## [Node.js client installation problem on Ubuntu 14.04 LTS](https://discuss.aerospike.com/t/node-js-client-installation-problem-on-ubuntu-14-04-lts/1925)

<div class="topic-metadata">

**Author:** [@Manoj\_Nair](https://discuss.aerospike.com/u/Manoj_Nair)\
**Replies:** 3\
**Last updated:** [November 8, 2019, 12:10pm UTC](https://discuss.aerospike.com/t/node-js-client-installation-problem-on-ubuntu-14-04-lts/1925 "2019-11-08T12:10:44Z")

</div>

After installing nodejs and npm on Ubuntu 14.04 LTS, getting the following error while installing node.js aerospike client: $sudo npm install aerospike -g sudo: unable to resolve host test-server npm http GET https://…

---

## [Aggregation udf in nodejs return unsupported feature)](https://discuss.aerospike.com/t/aggregation-udf-in-nodejs-return-unsupported-feature/6786)

<div class="topic-metadata">

**Author:** [@info2000](https://discuss.aerospike.com/u/info2000)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 2:34am UTC](https://discuss.aerospike.com/t/aggregation-udf-in-nodejs-return-unsupported-feature/6786 "2019-11-07T02:34:44Z")

</div>

Hello, in nodejs client, I’m receving the error detailed below when run this query apply udf with the where predicate. If I don’t set where, the query run perfectly, but I need filter by mapkey. The lua works, because in…

---

## [Problem with nodejs client, external loop capacity](https://discuss.aerospike.com/t/problem-with-nodejs-client-external-loop-capacity/6209)

<div class="topic-metadata">

**Author:** [@Dorijan\_Jelincic](https://discuss.aerospike.com/u/Dorijan_Jelincic)\
**Replies:** 2\
**Last updated:** [April 29, 2019, 4:00pm UTC](https://discuss.aerospike.com/t/problem-with-nodejs-client-external-loop-capacity/6209 "2019-04-29T16:00:57Z")

</div>

Hi, I am having trouble connecting to aerospike server using nodejs, I got this error: nodejs: symbol lookup error: /home/xxx/as/node/node\_modules/aerospike/build/Release/aerospike.node: undefined symbol: as\_event\_set\_e…

---

## [Client timeout - Error 9 in nodejs client after 100 sequential puts](https://discuss.aerospike.com/t/client-timeout-error-9-in-nodejs-client-after-100-sequential-puts/6126)

<div class="topic-metadata">

**Author:** [@Jose\_Ramon\_Fernandez](https://discuss.aerospike.com/u/Jose_Ramon_Fernandez)\
**Replies:** 9\
**Last updated:** [April 9, 2019, 3:59pm UTC](https://discuss.aerospike.com/t/client-timeout-error-9-in-nodejs-client-after-100-sequential-puts/6126 "2019-04-09T15:59:04Z")

</div>

Hello, I’m moving data from mysql to aerospike I used php client and nodejs client With php client all work fine with nodejs client, after ~100 inserts, the put method return error code 9 This are my writepolicy setting…

---

## [Evaluating Aerospike via Tweetaspike](https://discuss.aerospike.com/t/evaluating-aerospike-via-tweetaspike/5352)

<div class="topic-metadata">

**Author:** [@Lonnie](https://discuss.aerospike.com/u/Lonnie)\
**Replies:** 1\
**Last updated:** [July 20, 2018, 1:31am UTC](https://discuss.aerospike.com/t/evaluating-aerospike-via-tweetaspike/5352 "2018-07-20T01:31:17Z")

</div>

Hello, I new to Aerospike and am evaluating “tweetaspike” to see if the Aerospike database will meet my needs for the project that uses node.js of which I am also a bit new but coming from a C++ background, mostly. Wit…

---

## [Aerospike Node.js client log](https://discuss.aerospike.com/t/aerospike-node-js-client-log/5148)

<div class="topic-metadata">

**Author:** [@al-mehedi](https://discuss.aerospike.com/u/al-mehedi)\
**Replies:** 10\
**Last updated:** [May 15, 2018, 10:21am UTC](https://discuss.aerospike.com/t/aerospike-node-js-client-log/5148 "2018-05-15T10:21:52Z")

</div>

When I’m running my node.js app, every time my app made a connection to the Aerospike server - " INFO (28106) \[as\_cluster.c:124\] \[as\_cluster\_add\_nodes\_copy\] - Add node BB9853992913CF2" pops up. I have tried to set - log:…

---

## [Query example using async and await](https://discuss.aerospike.com/t/query-example-using-async-and-await/4945)

<div class="topic-metadata">

**Author:** [@helipilot50](https://discuss.aerospike.com/u/helipilot50)\
**Replies:** 1\
**Last updated:** [February 15, 2018, 1:43am UTC](https://discuss.aerospike.com/t/query-example-using-async-and-await/4945 "2018-02-15T01:43:24Z")

</div>

Can you provide a link to example that shows how to use a query with async/await

---

## [Clean shut down for aerospike Client for Node JS express server](https://discuss.aerospike.com/t/clean-shut-down-for-aerospike-client-for-node-js-express-server/4853)

<div class="topic-metadata">

**Author:** [@K\_K](https://discuss.aerospike.com/u/K_K)\
**Replies:** 5\
**Last updated:** [January 19, 2018, 4:44am UTC](https://discuss.aerospike.com/t/clean-shut-down-for-aerospike-client-for-node-js-express-server/4853 "2018-01-19T04:44:00Z")

</div>

I intend to do a clean shut down of the aerospike connection post the node js express shut down irrespective of the cause, based on experience will taking care of the following events: ‘exit’, ‘SIGINT’ and ‘uncaughtExce…

---

## [Join operation in Aerospike node client](https://discuss.aerospike.com/t/join-operation-in-aerospike-node-client/4809)

<div class="topic-metadata">

**Author:** [@Nikunj\_Patel](https://discuss.aerospike.com/u/Nikunj_Patel)\
**Replies:** 1\
**Last updated:** [December 11, 2017, 5:43pm UTC](https://discuss.aerospike.com/t/join-operation-in-aerospike-node-client/4809 "2017-12-11T17:43:47Z")

</div>

Can I do join operations like SQL. Or I want to get data from two tables in single query. Which is efficient way to get records?

---

## [Node.js client library for Windows](https://discuss.aerospike.com/t/node-js-client-library-for-windows/3640)

<div class="topic-metadata">

**Author:** [@mlamp](https://discuss.aerospike.com/u/mlamp)\
**Replies:** 10\
**Last updated:** [December 11, 2017, 5:36am UTC](https://discuss.aerospike.com/t/node-js-client-library-for-windows/3640 "2017-12-11T05:36:56Z")

</div>

Hello. To the point - our nodejs development team is using Windows and for that we cannot use Aerospike’s nodejs client library. Is there a way to compile C library for windows and point to it? Or what’s the best soluti…

---

## [Query.execute is not a function](https://discuss.aerospike.com/t/query-execute-is-not-a-function/4799)

<div class="topic-metadata">

**Author:** [@Nikunj\_Patel](https://discuss.aerospike.com/u/Nikunj_Patel)\
**Replies:** 1\
**Last updated:** [December 8, 2017, 6:21pm UTC](https://discuss.aerospike.com/t/query-execute-is-not-a-function/4799 "2017-12-08T18:21:56Z")

</div>

When I am trying to execute query using query.execute() than it shows it is not a function. I was already tried it and it was working before last 3 months. Is it removed from new aerospike node client update? And if yes…

---

## [Pagination in Ecommerce website](https://discuss.aerospike.com/t/pagination-in-ecommerce-website/4662)

<div class="topic-metadata">

**Author:** [@Piyush\_Aggarwal](https://discuss.aerospike.com/u/Piyush_Aggarwal)\
**Replies:** 2\
**Last updated:** [October 4, 2017, 7:24am UTC](https://discuss.aerospike.com/t/pagination-in-ecommerce-website/4662 "2017-10-04T07:24:17Z")

</div>

I am trying to build an ecommerce app, so what I need here is that I require products in batches with every API call like API will ask for the next 10 products from the timestamp value sent from the Application. I have …

[Next page](https://discuss.aerospike.com/c/client-libraries/node-js-client/13.md?page=1)
