Global

Type Definitions

ClientOptions

Client options
Type:
  • Object
Properties:
Name Type Description
contactPoints Array Array of addresses or host names of the nodes to add as contact point.
policies Object
Properties
Name Type Description
loadBalancing LoadBalancingPolicy The load balancing policy instance to be used to determine the coordinator per query.
retry RetryPolicy The retry policy.
reconnection ReconnectionPolicy The reconnection policy to be used.
queryOptions QueryOptions Default options for all queries.
pooling Object Pooling options.
Properties
Name Type Description
heartBeatInterval Number The amount of idle time in milliseconds that has to pass before the driver issues a request on an active connection to avoid idle time disconnections. Default: 30000.
coreConnectionsPerHost Object Associative array containing amount of connections per host distance.
protocolOptions Object
Properties
Name Type Description
port Number The port to use to connect to the Cassandra host. If not set through this method, the default port (9042) will be used instead.
maxSchemaAgreementWaitSeconds Number The maximum time in seconds to wait for schema agreement between nodes before returning from a DDL query. Default: 10.
socketOptions Object
Properties
Name Type Description
connectTimeout Number Connection timeout in milliseconds.
keepAlive Boolean Whether to enable TCP keepalive on the socket. Default: true.
keepAliveDelay Number TCP keepalive delay in milliseconds. Default: 0.
authProvider AuthProvider Provider to be used to authenticate to an auth-enabled host.
sslOptions Object Client-to-node ssl options, when set the driver will use the secure layer. You can specify cert, ca, ... options named after the Node.js tls.connect options.
encoding Object
Properties
Name Type Description
map function Map constructor to use for Cassandra map types encoding and decoding. If not set, it will default to Javascript Object with map keys as property names.
set function Set constructor to use for Cassandra set types encoding and decoding. If not set, it will default to Javascript Array

QueryOptions

Query options
Type:
  • Object
Properties:
Name Type Description
consistency Number Consistency level.
fetchSize Number Amount of rows to retrieve per page.
prepare Boolean Determines if the query must be executed as a prepared statement.
autoPage Boolean Determines if the driver must retrieve the next pages.
routingKey Buffer | Array Partition key(s) to determine which coordinator should be used for the query.
routingIndexes Array Index of the parameters that are part of the partition key to determine the routing.
routingNames Array Array of the parameters names that are part of the partition key to determine the routing.
hints Array | Array.<Array> Type hints for parameters given in the query, ordered as for the parameters. For batch queries, an array of such arrays, ordered as with the queries in the batch.
pageState Buffer | String Buffer or string token representing the paging state. Useful for manual paging, if provided, the query will be executed starting from a given paging state.
retry RetryPolicy Retry policy for the query. This property can be used to specify a different retry policy to the one specified in the ClientOptions.policies.

ResultCallback(err, result)

Callback used by execution methods.
Parameters:
Name Type Description
err Error Error occurred in the execution of the query.
result ResultSet Result of the execution of the query.