SDK
SDK Javascript v7.x
2

hkeys #

Returns all field names contained in a hash.

[Redis documentation]

Arguments #

Copied to clipboard!
hkeys(key, [options]);

Arguments Type Description
key
string
Hash key
options
object
Optional query arguments

options #

The options arguments can contain the following option properties:

Property Type (default) Description
queuable
boolean (true)
If true, queues the request during downtime, until connected to Kuzzle again

Resolve #

Resolves to an array of hash field names.

Usage #

Copied to clipboard!
try {
  await kuzzle.ms.hset('hashfoo', 'never', 'foo');
  await kuzzle.ms.hset('hashfoo', 'gonna', 'bar');
  await kuzzle.ms.hset('hashfoo', 'give you up', 'baz');
  // Prints: ['never', 'gonna', 'give you up']
  console.log(await kuzzle.ms.hkeys('hashfoo'));
} catch (error) {
  console.error(error.message);
}