Modules

Classes

ApplyPolicy
BatchApplyPolicy
BatchPolicy
BatchReadPolicy
BatchRemovePolicy
BatchWritePolicy
BitwisePolicy
CdtContext

Nested CDT context type.

Client

Construct a new Aerospike client instance.

Command
CommandQueuePolicy
Config
Double

Creates a new Double instance.

GeoJSON

Creates a new GeoJSON instance.

HLLPolicy
IndexJob
InfoPolicy
Job
Key

A key uniquely identifies a record in the Aerospike database within a given namespace.

ListPolicy
MapPolicy
BitwiseOperation
OverflowableBitwiseOp
ExpOperation
ExpOperation
SindexFilterPredicate
HLLOperation
ListOperation
MapOperation
Operation
Operation
OperatePolicy
Query
QueryPolicy
ReadPolicy
Record

Construct a new Aerospike Record instance.

A record with the Aerospike database consists of one or more record "bins" (name-value pairs) and meta-data, including time-to-live and generation; a record is uniquely identified by it's key within a given namespace.

RecordStream
RemovePolicy
Scan
ScanPolicy
UdfJob
WritePolicy

Events


disconnected

Since:
  • v2.7.0
Source:
Example
const Aerospike = require('aerospike')

Aerospike.connect((error, client) => {
  if (error) throw error

  client.on('disconnected', () => {
    console.warn('Client got disconnected from cluster')
  })

 // client is now ready to accept commands, e.g. get/put/...

})

event

Instead of adding listeners for the nodeAdded, nodeRemoved and disconnected events, applications can also subscribe to the event event to receive callbacks for any kind of cluster event.

Type: object
Properties:
Name Type Argument Description
name string

Name of the event.

nodeName string <optional>

Name of the cluster node that triggered this event.

nodeAddress string <optional>

IP address & port of the cluster node that triggered this event.

Since:
  • v2.7.0
Source:
Example
const Aerospike = require('aerospike')

Aerospike.connect((error, client) => {
  if (error) throw error

  client.on('event', (event) => {
    var now = new Date().toUTCString()
    console.info(now, event.name, event.nodeName)  // Example output:
                 // Thu, 13 Jul 2017 06:47:35 GMT nodeAdded BB94DC07D270009
                 // Thu, 13 Jul 2017 06:47:35 GMT nodeAdded C1D4DC0AD270002
                 // Thu, 13 Jul 2017 06:48:52 GMT nodeRemoved C1D4DC0AD270002
                 // Thu, 13 Jul 2017 06:49:08 GMT nodeRemoved BB94DC07D270009
                 // Thu, 13 Jul 2017 06:49:08 GMT disconnected
  })

 // client is now ready to accept commands, e.g. get/put/...

})

nodeAdded

Type: object
Properties:
Name Type Description
nodeName string

Name of the cluster node that triggered this event.

nodeAddress string

IP address & port of the cluster node that triggered this event.

Since:
  • v2.7.0
Source:

nodeRemoved

Type: object
Properties:
Name Type Description
nodeName string

Name of the cluster node that triggered this event.

nodeAddress string

IP address & port of the cluster node that triggered this event.

Since:
  • v2.7.0
Source:

data

Parameters:
Name Type Description
record Record

Aerospike record incl. bins, key and meta data. Depending on the operation, all, some or no bin values will be returned.

Source:

end

Source:

error

Type: AerospikeError
Source: