Class: OperatePolicy

OperatePolicy

A policy affecting the behavior of operate operations.


new OperatePolicy( [props])

Initializes a new OperatePolicy from the provided policy values.

Parameters:
Name Type Argument Description
props Object <optional>

Policy values

Since:
  • v3.0.0
Source:

Extends

Members


commitLevel :number

Specifies the number of replicas required to be committed successfully when writing before returning transaction succeeded.

Type:
  • number
Source:
See:

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.

Type:
  • boolean
Since:
  • v3.14.0
Inherited From:
Overrides:
Source:

deserialize :boolean

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

Type:
  • boolean
Since:
  • v3.7.0
Default Value:
  • true
Source:

durableDelete :boolean

Specifies whether a tombstone should be written in place of a record that gets deleted as a result of this operation.

Type:
  • boolean
Default Value:
  • false (do not tombstone deleted records)
Source:

exists :number

Specifies the behavior for the existence of the record.

Type:
  • number
Source:
See:

filterExpression

Optional expression filter. If filter exp exists and evaluates to false, the transaction 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:

Inherited From:
Overrides:
Source:

gen :number

Specifies the behavior for the generation value.

Type:
  • number
Source:
See:

key :number

Specifies the behavior for the key.

Type:
  • number
Source:
See:

maxRetries :number

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

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

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

Type:
  • number
Inherited From:
Overrides:
Source:

readModeAP :number

Read policy for AP (availability) namespaces.

Type:
  • number
Default Value:
  • Aerospike.policy.readModeAP.ONE
Source:
See:

readModeSC :number

Read policy for SC (strong consistency) namespaces.

Type:
  • number
Default Value:
  • Aerospike.policy.readModeSC.SESSION
Source:
See:

replica :number

Specifies the replica to be consulted for the read operation.

Type:
  • number
Source:
See:

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 transaction 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.

Type:
  • number
Inherited From:
Overrides:
Default Value:
  • 0 (no socket idle time limit).
Source:

totalTimeout :number

Total transaction timeout in milliseconds.

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

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

Type:
  • number
Inherited From:
Overrides:
Default Value:
  • 1000
Source: