Classes
- BitwiseOperation
- OverflowableBitwiseOp
- ExpOperation
- SindexFilterPredicate
- HLLOperation
- ListOperation
- MapOperation
- Operation
- ApplyPolicy
- BasePolicy
- 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
- OperatePolicy
- Query
- QueryPolicy
- ReadPolicy
- Record
Construct a new Aerospike Record instance.
- RecordStream
- RemovePolicy
- Scan
- ScanPolicy
- UdfJob
- WritePolicy
Events
-
disconnected
-
Example
const Aerospike = require('aerospike') // INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE! var config = { hosts: '192.168.33.10:3000', } Aerospike.connect(config, (error, client) => { if (error) throw error client.on('disconnected', () => { console.log('Client got disconnected from cluster') }) // client is now ready to accept commands, e.g. get/put/... client.close() })
-
event
-
Instead of adding listeners for the
nodeAdded
,nodeRemoved
anddisconnected
events, applications can also subscribe to theevent
event to receive callbacks for any kind of cluster event.Type: object
- Since:
-
- v2.7.0
- Source:
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.
Example
const Aerospike = require('aerospike') Aerospike.connect((error, client) => { if (error) throw error client.on('event', (event) => { var now = new Date().toUTCString() console.log(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/... client.close() })
-
nodeAdded
-
Type: object
-
nodeRemoved
-
Type: object
-
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: