This module defines a filter expression that is a mechanism for additional filtering.
The resultset of a primary index (PI) query (scan) or secondary index (SI) query operation can be filtered through the QueryPolicy and ScanPolicy classes. It can also filter single key operations and batch operations through the filterExpression field of their policy class.
Filter Expressions replace PredicateExpression filtering, which was deprecated in server 5.2 and removed in server 6.0.
- Description:
This module defines a filter expression that is a mechanism for additional filtering.
The resultset of a primary index (PI) query (scan) or secondary index (SI) query operation can be filtered through the QueryPolicy and ScanPolicy classes. It can also filter single key operations and batch operations through the filterExpression field of their policy class.
Filter Expressions replace PredicateExpression filtering, which was deprecated in server 5.2 and removed in server 6.0.
- Source:
- See:
Examples
const Aerospike = require('aerospike')
const op = Aerospike.operations
const exp = Aerospike.exp
const key = new Aerospike.Key('test', 'demo', 'mykey1')
const tempBin = 'ExpVar' // this bin is to hold expression read operation output
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
const config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
operate : new Aerospike.OperatePolicy({socketTimeout : 0, totalTimeout : 0}),
write : new Aerospike.WritePolicy({socketTimeout : 0, totalTimeout : 0})
}
}
var ops = [
op.append('a', 'xyz'),
op.incr('b', 10),
exp.operations.read(tempBin,
exp.add(exp.binInt('b'), exp.binInt('b')),
0),
op.read('a'),
op.read('b')
]
Aerospike.connect(config, (error, client) => {
if (error) throw error
client.put(key, { a: 'abc', b: 42 }, (error) => {
if (error) throw error
client.operate(key, ops, (error, record) => {
if (error) throw error
console.log(record.bins) // => { a: 'abcxyz', b: 52, ExpVar: 104 }
client.close()
})
})
})
const Aerospike = require('aerospike')
const op = Aerospike.operations
const exp = Aerospike.exp
const key = new Aerospike.Key('test', 'demo', 'mykey1')
const tempBin = 'ExpVar' // this bin is to hold expression read operation output
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
const config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
query : new Aerospike.QueryPolicy({socketTimeout : 0, totalTimeout : 0}),
write : new Aerospike.WritePolicy({socketTimeout : 0, totalTimeout : 0, exists : Aerospike.policy.exists.REPLACE})
}
}
Aerospike.connect(config, (error, client) => {
if (error) throw error
client.put(key, { a: 'abc', b: 42 }, (error) => {
if (error) throw error
var query = client.query('test', 'demo')
const queryPolicy = { filterExpression: exp.eq(exp.binInt('b'), exp.int(42))}
query.nobins = false
const stream = query.foreach(queryPolicy)
stream.on('error', (error) => {
console.error(error)
throw error
})
stream.on('data', (record) => {
console.info(record.bins) // => { a: 'abc', b: 42}
})
stream.on('end', () => {
client.close()
})
})
})
Members
(static) bit
Blob expressions.
- Description:
The
aerospike/exp/bit
module defines functions for expressions on the Blob datatype
- Source:
The aerospike/exp/bit
module defines functions
for expressions on the Blob datatype
(static, readonly) expReadFlags :number
Properties:
Name | Type | Description |
---|---|---|
DEFAULT |
number | Default. |
EVAL_NO_FAIL |
number | Ignore failures caused by the expression resolving to unknown or a non-bin type. |
Expression read bit flags. Use BITWISE OR to combine flags.
Type:
- number
(static, readonly) expWriteFlags :number
Properties:
Name | Type | Description |
---|---|---|
DEFAULT |
number | Default. |
CREATE_ONLY |
number | If bin does not exist, a new bin will be created. |
UPDATE_ONLY |
number | If bin exists, the bin will be overwritten. |
ALLOW_DELETE |
number | If expression results in nil value, then delete the bin. |
POLICY_NO_FAIL |
number | Do not raise error if operation is denied. |
EVAL_NO_FAIL |
number | Ignore failures caused by the expression resolving to unknown or a non-bin type. |
Expression write bit flags. Use BITWISE OR to combine flags.
Type:
- number
(static) hll
HyperLogLog expressions.
- Description:
The
aerospike/exp/hll
module defines functions for expressions on the HyperLogLog datatype
- Source:
The aerospike/exp/hll
module defines functions
for expressions on the HyperLogLog datatype
(static) lists
List expressions.
- Description:
The
aerospike/exp/lists
module defines functions for expressions on the List datatype.
- Source:
The aerospike/exp/lists
module defines functions
for expressions on the List datatype.
(static) maps
Map expressions.
- Description:
The
aerospike/exp/maps
module defines functions for expressions on the Map datatype.
- Source:
The aerospike/exp/maps
module defines functions
for expressions on the Map datatype.
Methods
(static) abs() → {AerospikeExp}
- Description:
Create operator that returns absolute value of a number. All arguments must resolve to integer or float. Requires server version 5.6.0+.
- Source:
Returns:
number value
- Type
- AerospikeExp
(static) add() → {AerospikeExp}
- Description:
Create "add" (+) operator that applies to a variable number of expressions. Return the sum of all arguments. All arguments must be the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
Array.<number> | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) and() → {AerospikeExp}
- Description:
Create "and" (&&) operator that applies to a variable number of expressions.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of boolean expressions. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) binBlob(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a blob. Returns 'unknown' if the bin is not an blob.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
blob bin
- Type
- AerospikeExp
(static) binBool(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a boolean value. Returns 'unknown' if the bin is not a boolean.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
boolean bin
- Type
- AerospikeExp
(static) binExists(binName) → {boolean}
- Description:
Create expression that returns if bin of specified name exists.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
- value True if the bin exists, false otherwise.
- Type
- boolean
(static) binFloat(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a float. Returns 'unknown' if the bin is not an float.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
float bin
- Type
- AerospikeExp
(static) binGeo(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a geojson. Returns 'unknown' if the bin is not geojson.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
geojson bin
- Type
- AerospikeExp
(static) binHll(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a HyperLogLog (hll). Returns 'unknown' if the bin is not a HyperLogLog (hll).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
hll bin
- Type
- AerospikeExp
(static) binInt(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a signed integer. Returns 'unknown' if the bin is not an integer.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
integer bin
- Type
- AerospikeExp
(static) binList(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a list. Returns 'unknown' if the bin is not an list.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
list bin
- Type
- AerospikeExp
(static) binMap(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a map. Returns 'unknown' if the bin is not an map.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
map bin
- Type
- AerospikeExp
(static) binStr(binName) → {AerospikeExp}
- Description:
Create expression that returns a bin as a string. Returns 'unknown' if the bin is not an string.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
binName |
string | Bin name. |
Returns:
string bin
- Type
- AerospikeExp
(static) bool(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | boolean value. |
Returns:
- Type
- AerospikeExp
(static) bytes(value, size) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
Array.<string> | byte array value. |
size |
number | number of bytes. |
Returns:
- Type
- AerospikeExp
(static) ceil(num) → {AerospikeExp}
- Description:
Create expression that rounds a floating point number up to the closest integer value. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Floating point value to round up. |
Returns:
integer-value
- Type
- AerospikeExp
(static) cmpGeo(left, right) → {AerospikeExp}
- Description:
Create a point within region or region contains point expression.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) cmpRegex(options, regex, cmpStr) → {AerospikeExp}
- Description:
Create expression that performs a regex match on a string bin or value expression.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
options |
number | POSIX regex flags defined in regex.h. |
regex |
string | POSIX regex string. |
cmpStr |
AerospikeExp | String expression to compare against. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) cond() → {AerospikeExp}
- Description:
Conditionally select an expression from a variable number of expression pairs followed by default expression action. Requires server version 5.6.0+.
- Source:
Parameters:
Type | Description |
---|---|
AerospikeExp |
Returns:
first action expression where bool expression is true or action-default.
- Type
- AerospikeExp
(static) def(varName, expr) → {AerospikeExp}
- Description:
Assign variable to an expression that can be accessed later. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
varName |
string | Variable name. |
expr |
AerospikeExp | The variable is set to the result of expr. |
Returns:
A variable name expression pair.
- Type
- AerospikeExp
(static) deviceSize() → {AerospikeExp}
- Description:
Create expression that returns record size on disk. If server storage-engine is memory, then zero is returned. This expression usually evaluates quickly because record meta data is cached in memory. Requires server version between 5.3.0 inclusive and 7.0 exclusive. Use
#recordSize
for server version 7.0+.
- Source:
Returns:
integer value Uncompressed storage size of the record.
- Type
- AerospikeExp
(static) digestModulo(mod) → {AerospikeExp}
- Description:
Create expression that returns record digest modulo as integer.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
mod |
number | Divisor used to divide the digest to get a remainder. |
Returns:
integer value Value in range 0 and mod (exclusive)..
- Type
- AerospikeExp
(static) div() → {AerospikeExp}
- Description:
Create "divide" (/) operator that applies to a variable number of expressions. If there is only one argument, returns the reciprocal for that argument. Otherwise, return the first argument divided by the product of the rest. All arguments must resolve to the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
Array.<number> | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) eq(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) exclusive() → {AerospikeExp}
- Description:
Create expression that returns true if only one of the expressions are true. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of boolean expressions. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) float(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
number | floating point value. |
Returns:
- Type
- AerospikeExp
(static) floor(num) → {AerospikeExp}
- Description:
Create expression that rounds a floating point number down to the closest integer value. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Floating point value to round down. |
Returns:
float-value
- Type
- AerospikeExp
(static) ge(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) geo(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
Object | geojson value. |
Returns:
- Type
- AerospikeExp
(static) gt(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) inf() → {AerospikeExp}
Returns:
- Type
- AerospikeExp
(static) int(number) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
number |
number | value integer value. |
Returns:
- Type
- AerospikeExp
(static) intAnd() → {AerospikeExp}
- Description:
Create integer "and" (&) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of integer expressions. |
Returns:
integer value
- Type
- AerospikeExp
(static) intArshift(value, shift) → {AerospikeExp}
- Description:
Create integer "arithmetic right shift" (>>) operator. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
AerospikeExp | Integer expression. |
shift |
number | Number of bits to shift by. |
Returns:
integer value
- Type
- AerospikeExp
(static) intCount() → {AerospikeExp}
- Description:
Create expression that returns count of integer bits that are set to 1. Requires server version 5.6.0+.
- Source:
Parameters:
Type | Description |
---|---|
AerospikeExp |
Returns:
integer value
- Type
- AerospikeExp
(static) intLscan() → {AerospikeExp}
- Description:
Create expression that scans integer bits from left (most significant bit) to right (least significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0. Requires server version 5.6.0+.
- Source:
Parameters:
Type | Description |
---|---|
AerospikeExp |
Returns:
integer value
- Type
- AerospikeExp
(static) intLshift(value, shift) → {AerospikeExp}
- Description:
Create integer "left shift" (<<) operator. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
AerospikeExp | Integer expression. |
shift |
number | Number of bits to shift by. |
Returns:
integer value
- Type
- AerospikeExp
(static) intNot(expr) → {AerospikeExp}
- Description:
Create integer "not" (~) operator. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
expr |
AerospikeExp | Integer expression. |
Returns:
integer value
- Type
- AerospikeExp
(static) intOr() → {AerospikeExp}
- Description:
Create integer "or" (|) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of integer expressions. |
Returns:
integer value
- Type
- AerospikeExp
(static) intRscan() → {AerospikeExp}
- Description:
Create expression that scans integer bits from right (least significant bit) to left (most significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0. Requires server version 5.6.0+.
- Source:
Parameters:
Type | Description |
---|---|
AerospikeExp |
Returns:
integer value
- Type
- AerospikeExp
(static) intRshift(value, shift) → {AerospikeExp}
- Description:
Create integer "logical right shift" (>>>) operator. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
AerospikeExp | Integer expression. |
shift |
number | Number of bits to shift by. |
Returns:
integer value
- Type
- AerospikeExp
(static) intXor() → {AerospikeExp}
- Description:
Create integer "xor" (^) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of integer expressions. |
Returns:
integer value
- Type
- AerospikeExp
(static) isTombstone() → {AerospikeExp}
- Description:
Create expression that returns if record has been deleted and is still in tombstone state. This expression usually evaluates quickly because record meta data is cached in memory.
- Source:
Returns:
- value True if the record is a tombstone, false otherwise.
- Type
- AerospikeExp
(static) keyBlob(blob) → {AerospikeExp}
- Description:
Create expression that returns the key as an blob. Returns 'unknown' if the key is not an blob.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
blob |
Object | Blob value of the key if the key is a blob. |
Returns:
- Type
- AerospikeExp
(static) keyExist() → {AerospikeExp}
- Description:
Create expression that returns if the primary key is stored in the record meta data as a boolean expression. This would occur when "policy write key" is SEND on record write.
- Source:
Parameters:
Type | Description |
---|---|
boolean | value True if the record has a stored key, false otherwise. |
Returns:
- Type
- AerospikeExp
(static) keyInt(integer) → {AerospikeExp}
- Description:
Create expression that returns the key as an integer. Returns 'unknown' if the key is not an integer.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
integer |
number | value Integer value of the key if the key is an integer. |
Returns:
- Type
- AerospikeExp
(static) keyStr(string) → {AerospikeExp}
- Description:
Create expression that returns the key as an string. Returns 'unknown' if the key is not a string.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
string |
string | value String value of the key if the key is a string. |
Returns:
- Type
- AerospikeExp
(static) lastUpdate() → {AerospikeExp}
- Description:
Create expression that returns record last update time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
- Source:
Returns:
integer value When the record was last updated.
- Type
- AerospikeExp
(static) le(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) let() → {AerospikeExp}
- Description:
Define variables and expressions in scope. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of expression def followed by a scoped expression. |
Returns:
result of scoped expression.
- Type
- AerospikeExp
(static) list(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
array | list value |
Returns:
- Type
- AerospikeExp
(static) log(num, base) → {AerospikeExp}
- Description:
Create "log" operator for logarithm of "num" with base "base". All arguments must resolve to floats. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Number. |
base |
number | Base value. |
Returns:
float value
- Type
- AerospikeExp
(static) lt(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) map(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
array | map value |
Returns:
- Type
- AerospikeExp
(static) max() → {AerospikeExp}
- Description:
Create expression that returns the maximum value in a variable number of expressions. All arguments must be the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) memorySize() → {AerospikeExp}
- Description:
Create expression that returns record size in memory when either the storage-engine is memory or data-in-memory is true, otherwise returns 0. This expression usually evaluates quickly because record meta data is cached in memory. Requires server version between 5.3.0 inclusive and 7.0 exclusive. Use
#recordSize
for server version 7.0+.
- Source:
Returns:
integer value memory size of the record.
- Type
- AerospikeExp
(static) min() → {AerospikeExp}
- Description:
Create expression that returns the minimum value in a variable number of expressions. All arguments must be the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) mod() → {AerospikeExp}
- Description:
Create "modulo" (%) operator that determines the remainder of "numerator" divided by "denominator". All arguments must resolve to integers. Requires server version 5.6.0+.
- Source:
Returns:
integer value
- Type
- AerospikeExp
(static) mul() → {AerospikeExp}
- Description:
Create "multiply" (*) operator that applies to a variable number of expressions. Return the product of all arguments. If only one argument is supplied, return that argument. All arguments must resolve to the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
Array.<number> | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) ne(left, right) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
left |
number | left expression in comparison. |
right |
number | right expression in comparison. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) nil() → {AerospikeExp}
Returns:
- Type
- AerospikeExp
(static) not(expr) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
expr |
AerospikeExp | Boolean expression to negate. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) or() → {AerospikeExp}
- Description:
Create "or" (||) operator that applies to a variable number of expressions.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
AerospikeExp | Variable number of boolean expressions. |
Returns:
- boolean value
- Type
- AerospikeExp
(static) pow(base, exponent) → {AerospikeExp}
- Description:
Create "pow" operator that raises a "base" to the "exponent" power. All arguments must resolve to floats. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
base |
number | Base value. |
exponent |
number | Exponent value. |
Returns:
float value
- Type
- AerospikeExp
(static) recordSize() → {AerospikeExp}
- Description:
Create expression that returns the record size. This expression usually evaluates quickly because record meta data is cached in memory. Requires server version 7.0+. This expression replaces
#deviceSize
and#memorySize
since those older expressions are equivalent on server version 7.0+.
- Source:
Returns:
integer value size of the record in Megabytes.
- Type
- AerospikeExp
(static) setName() → {AerospikeExp}
- Description:
Create expression that returns record set name string. This expression usually evaluates quickly because record meta data is cached in memory.
- Source:
Returns:
string value Name of the set this record belongs to.
- Type
- AerospikeExp
(static) sinceUpdate() → {AerospikeExp}
- Description:
Create expression that returns milliseconds since the record was last updated. This expression usually evaluates quickly because record meta data is cached in memory.
- Source:
Returns:
integer value Number of milliseconds since last updated.
- Type
- AerospikeExp
(static) str(value) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
value |
string | string value. |
Returns:
- Type
- AerospikeExp
(static) sub() → {AerospikeExp}
- Description:
Create "subtract" (-) operator that applies to a variable number of expressions. If only one argument is provided, return the negation of that argument. Otherwise, return the sum of the 2nd to Nth argument subtracted from the 1st argument. All arguments must resolve to the same type (integer or float). Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
... |
Array.<number> | Variable number of integer or float expressions. |
Returns:
integer or float value
- Type
- AerospikeExp
(static) toFloat(num) → {AerospikeExp}
- Description:
Create expression that converts an integer to a float. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Integer to convert to a float |
Returns:
float value
- Type
- AerospikeExp
(static) toInt(num) → {AerospikeExp}
- Description:
Create expression that converts a float to an integer. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Integer to convert to a float |
Returns:
float value
- Type
- AerospikeExp
(static) ttl() → {AerospikeExp}
- Description:
Create expression that returns record expiration time (time to live) in integer seconds.
- Source:
Returns:
integer value Number of seconds till the record will expire, returns -1 if the record never expires.
- Type
- AerospikeExp
(static) uint(number) → {AerospikeExp}
Parameters:
Name | Type | Description |
---|---|---|
number |
number | value unsigned integer value. |
Returns:
- Type
- AerospikeExp
(static) var(varName) → {AerospikeExp}
- Description:
Retrieve expression value from a variable. Requires server version 5.6.0+.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
varName |
string | Variable name. |
Returns:
value stored in variable.
- Type
- AerospikeExp
(static) voidTime() → {AerospikeExp}
- Description:
Create expression that returns record expiration time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
- Source:
Returns:
integer value Expiration time in nanoseconds since 1970-01-01.
- Type
- AerospikeExp
(static) wildcard() → {AerospikeExp}
Returns:
- Type
- AerospikeExp