A policy affecting the behavior of query commands.

v3.0.0

Hierarchy (view full)

Constructors

Properties

compress?: boolean

Use zlib compression on write or batch read commands when the command buffer size is greater than 128 bytes. In addition, tell the server to compress it's response on read commands. The server response compression threshold is also 128 bytes.

This option will increase cpu and memory usage (for extra compressed buffers), but decrease the size of data sent over the network.

Requires Enterprise Server version >= 4.8.

@default: false

v3.14.0

deserialize?: boolean

Should CDT data types (Lists / Maps) be deserialized to JS data types (Arrays / Objects) or returned as raw bytes (Buffer).

<code>true</code>

v3.7.0

expectedDuration?: queryDuration

Expected query duration. The server treats the query in different ways depending on the expected duration. This field is ignored for aggregation queries, background queries and server versions < 6.0.

policy.queryDuration for supported policy values.

failOnClusterChange?: boolean

Terminate the query if the cluster is in migration state. If the query's "where" clause is not defined (scan), this field is ignored.

Requires Aerospike Server version 4.2.0.2 or later.

<code>false</code>

v3.4.0

filterExpression?: AerospikeExp

Optional expression filter. If filter exp exists and evaluates to false, the command is ignored. This can be used to eliminate a client/server roundtrip in some cases.

expression filters can only be applied to the following commands:

infoTimeout?: number

Timeout in milliseconds used when the client sends info commands to check for cluster changes before and after the query. This timeout is only used when failOnClusterChange is true and the query's "where" clause is defined.

10000 ms

v3.16.5

maxRetries?: number

Maximum number of retries before aborting the current command. The initial attempt is not counted as a retry.

If maxRetries is exceeded, the command will return error ERR_TIMEOUT.

WARNING: Database writes that are not idempotent (such as "add") should not be retried because the write command may be performed multiple times if the client timed out previous command attempts. It is important to use a distinct write policy for non-idempotent writes which sets maxRetries to zero.

@default: 2 (initial attempt + 2 retries = 3 attempts)

replica?: replica

Specifies the replica to be consulted for the query command.

policy.replica for supported policy values.

socketTimeout?: number

Socket idle timeout in milliseconds when processing a database command.

If socketTimeout is not zero and the socket has been idle for at least socketTimeout, both maxRetries and totalTimeout are checked. If maxRetries and totalTimeout are not exceeded, the command is retried.

If both socketTimeout and totalTimeout are non-zero and socketTimeout > totalTimeout, then socketTimeout will be set to totalTimeout. If socketTimeout is zero, there will be no socket idle limit.

0 (no socket idle time limit).
totalTimeout?: number

Total command timeout in milliseconds.

The totalTimeout is tracked on the client and sent to the server along with the command in the wire protocol. The client will most likely timeout first, but the server also has the capability to timeout the command

If totalTimeout is not zero and totalTimeout is reached before the command completes, the command will return error ERR_TIMEOUT. If totalTimeout is zero, there will be no total time limit.

0
@override

Transaction identifier. See Transaction for more information.

null (no transaction)
MMNEPVFCICPMFPCPTTAAATR