Class: Response

vertx-redis-js/response~ Response

new Response()

The response received from the REDIS server. Redis responses can have several representations:
  • simple string - C string
  • integer - 64bit integer value
  • bulk - byte array
  • multi - list
Due to the dynamic nature the response object will try to cast the received response to the desired type. A special case should be noted that multi responses are also handled by the response object as it implements the iterable interface. So in this case constructs like for loops on the response will give you access to the underlying elements.
Source:

Methods

get(key) → {Response}

Get this multi response value at a string key. Note that REDIS does not support strings as keys but by convention it encodes hashes in lists where index i is the key, and index i+1 is the value.
Parameters:
Name Type Description
key string the required key.
Source:
Returns:
Response value.
Type
Response

getKeys() → {Array.<string>}

Get this multi response keys from a hash. Note that REDIS does not support strings as keys but by convention it encodes hashes in lists where index i is the key, and index i+1 is the value.
Source:
Returns:
the set of keys.
Type
Array.<string>

size() → {number}

Get this size of this multi response.
Source:
Returns:
the size of the multi.
Type
number

toBoolean() → {boolean}

Get this response as a Boolean.
Source:
Returns:
boolean value.
Type
boolean

toBuffer() → {Buffer}

Get this response as Buffer.
Source:
Returns:
buffer value.
Type
Buffer

toByte() → {number}

Get this response as a Byte.
Source:
Returns:
byte value.
Type
number

toInteger() → {number}

Get this response as a Integer.
Source:
Returns:
int value.
Type
number

toLong() → {number}

Get this response as a Long.
Source:
Returns:
long value.
Type
number

toShort() → {number}

Get this response as a Short.
Source:
Returns:
short value.
Type
number

toString() → {string}

Get this response as a String.
Source:
Returns:
string value
Type
string

type() → {Object}

The response return type.
Source:
Returns:
the type.
Type
Object