Record metadata
Returns the value of in-memory metadata. Expressions attempt to resolve with metadata only prior to loading the record from storage.
device_size
Introduced: 5.2.0.4
device_size()
Returns the record's storage size in bytes as an integer. Value is 0 when namespace is configured storage-engine memory
.
Note: deprecated as of Aerospike Database 7.0.
Returns: (integer_value)
Example: Find records that occupy more than 1 MiB of storage space.
- C
- Java
as_exp_build(predexp,
as_exp_gt(as_exp_device_size(), as_exp_int(1024 * 1024)));
Expression exp = Exp.build(
Exp.gt(Exp.deviceSize(), Exp.val(1024 * 1024)));
memory_size
Introduced: 5.3.0
memory_size()
Starting with Database 7.0: Returns the record's size in bytes as an integer when the namespace is configured storage-engine memory
, otherwise returns 0.
Prior to Database 7.0: Returns the record's memory size in bytes as an integer when either the namespace is configured data-in-memory true
or storage-engine memory
, otherwise returns 0.
Note: deprecated as of Database 7.0. Use record_size
instead.
Returns: (integer_value)
Example: Find records that occupy more than 1 MiB of memory.
- C
- Java
as_exp_build(predexp,
as_exp_gt(as_exp_memory_size(), as_exp_int(1024 * 1024)));
Expression exp = Exp.build(
Exp.gt(Exp.memorySize(), Exp.val(1024 * 1024)));
record_size
Introduced: 7.0
record_size()
Returns the record's size in bytes as an integer.
Returns: (integer_value)
Example: Find records that occupy more than 1 MiB of memory.
- C
- Java
as_exp_build(predexp,
as_exp_gt(as_exp_record_size(), as_exp_int(1024 * 1024)));
Expression exp = Exp.build(
Exp.gt(Exp.recordSize(), Exp.val(1024 * 1024)));
digest_modulo
Introduced: 5.2.0.4
digest_modulo(mod)
Returns a record digest modulo as an integer.
- mod (integer_value)
Returns: (integer_value)
Example: Sample records where digest mod 3 equals 0
- C
- Java
as_exp_build(predexp,
as_exp_cmp_eq(as_exp_digest_modulo(3), as_exp_int(0)));
Expression exp = Exp.build(
Exp.eq(Exp.digestModulo(3), Exp.val(0)));
is_tombstone
Introduced: 5.2.0.4
is_tombstone()
Returns true
if the record is a tombstone, otherwise it returns false
.
Note: Only applies to XDR filters and when used in a write request with a read/write expressions.
Returns: (boolean_value)
Example: Create an XDR filter to only ship tombstones.
- C
- Java
as_exp_build(predexp, as_exp_is_tombstone());
Expression exp = Exp.build(Exp.isTombstone());
key_exists
Introduced: 5.2.0.4
key_exists()
"Returns true
if the record has a stored key, otherwise it returns false
."
Returns: (boolean_value)
Example: Return all records that have a stored key.
- C
- Java
as_exp_build(predexp, as_exp_key_exists());
Expression exp = Exp.build(Exp.keyExists());
last_update
Introduced: 5.2.0.4
last_update()
Returns the record's last-update-time (LUT) in nanoseconds (millisecond resolution) from Unix Epoch (1/1/1970) as an integer.
Returns: (integer_value)
Example: Return all records where the last-update-time is less than bin 'updateBy'.
- C
- Java
as_exp_build(predexp,
as_exp_cmp_lt(
as_exp_last_update(), as_exp_bin_int("updateby")));;
Expression exp = Exp.build(
Exp.lt(Exp.lastUpdate(), Exp.intBin("updateBy")));
since_update
Introduced: 5.2.0.4
since_update()
Returns the time (in milliseconds) since the record was last updated.
Returns: (integer_value)
Example: Return records that were updated within the last 2 hours.
- C
- Java
as_exp_build(predexp,
as_exp_cmp_lt(
as_exp_since_update(), as_exp_int(2 * 60 * 60 * 1000)));;
Expression exp = Exp.build(
Exp.lt(Exp.sinceUpdate(), Exp.val(2 * 60 * 60 * 1000)));
set_name
Introduced: 5.2.0.4
set_name()
Returns the record's set_name as a string.
Returns: (string_value)
Example: Return all records where the set_name is either 'groupA' or 'groupB'.
- C
- Java
as_exp_build(predexp, as_exp_or(
as_exp_cmp_eq(as_exp_set_name(), as_exp_str("groupA")),
as_exp_cmp_eq(as_exp_set_name(), as_exp_str("groupB"))));
Expression exp = Exp.build(Exp.or(
Exp.eq(Exp.setName(), Exp.val("groupA")),
Exp.eq(Exp.setName(), Exp.val("groupB"))));
ttl
Introduced: 5.2.0.4
ttl()
Returns the record's TTL (Time To Live) as an integer.
Returns: (integer_value)
Example: Return all records that will expire within 24 hours.
- C
- Java
as_exp_build(predexp,
as_exp_cmp_le(as_exp_ttl(), as_exp_int(24 * 60 * 60)));
Expression exp = Exp.build(
Exp.le(Exp.ttl(), Exp.val(24 * 60 * 60)));
void_time
Introduced: 5.2.0.4
void_time()
Returns the record's expiration time in nanoseconds (resolution in seconds) as an integer.
Returns: (integer_value)
Example: Return all records where the void-time is set to 'never expire'.
- C
- Java
as_exp_build(predexp,
as_exp_cmp_eq(as_exp_void_time(), as_exp_int(-1)))
Expression exp = Exp.build(Exp.eq(Exp.voidTime(), Exp.val(-1)));