Class: Key

Key


new Key(ns, set, key)

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

Key Digests

In your application, you must specify the namespace, set and the key itself to read and write records. When a key is sent to the database, the key value and its set are hashed into a 160-bit digest. When a database operation returns a key (e.g. Query or Scan operations) it might contain either the set and key value, or just the digest.

Parameters:
Name Type Description
ns string

The Namespace to which the key belongs.

set string

The Set to which the key belongs.

key string | number | Buffer

The unique key value. Keys can be strings, integers or an instance of the Buffer class.

Source:
Example

Creating a new Key instance

const Aerospike = require('aerospike')
const Key = Aerospike.Key

var key1 = new Key('test', 'demo', 12345)
var key2 = new Key('test', 'demo', 'abcde')
var key3 = new Key('test', 'demo', Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]))

Members


digest :Buffer

The 160-bit digest used by the Aerospike server to uniquely identify a record within a namespace.

Type:
  • Buffer
Source:

key :string|integer|Buffer

Type:
  • string | integer | Buffer
Source:

ns :string

Type:
  • string
Source:

set :string

Type:
  • string
Source: