Constructor
new Encoder(protocolVersion, options)
Serializes and deserializes to and from a CQL type and a Javascript Type.
Parameters:
Name | Type | Description |
---|---|---|
protocolVersion |
Number | |
options |
ClientOptions |
Methods
decode(buffer, type)
Decodes Cassandra bytes into Javascript values.
This is part of an experimental API, this can be changed future releases.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buffer |
Buffer | Raw buffer to be decoded. | ||||||||||||
type |
Object | An object containing the data type code and info .
Properties
|
encode(value, typeInfoopt) → {Buffer}
Encodes Javascript types into Buffer according to the Cassandra protocol.
This is part of an experimental API, this can be changed future releases.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
* | The value to be converted. | |
typeInfo |
Object | String | Number |
<optional> |
The type information.
It can be either a: |
Throws:
-
When there is an encoding error
- Type
- TypeError
Returns:
- Type
- Buffer