Skip to content

Record storage

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Record storage expressions read a record’s own data as typed values: its bins, its primary key, and whether a bin exists. Together with record metadata, they are the leaves of an expression tree — every other expression in this reference takes its operands from one of these, or from another expression built on them.

Use a typed reader as the operand of a comparison or logic filter, as the collection operand of a list, map, or HLL expression, as the string operand of a string expression, or as the root of a path filter over nested data.

A typed reader evaluates to unknown when the bin is absent or holds a different type; see Unknown results. The key readers follow the same rule, so read a key with the reader matching how it was written — key_int, key_str, or key_blob.

bin_type is the exception to the pattern. It evaluates to an integer code naming the bin’s data type rather than to the bin’s value, which makes it the way to branch on what a bin holds before reading it.

The Developer SDK’s AEL text syntax infers most of these types from paths and literals, so an explicit typed reader is rarely needed.

Each operation’s Example shows the code in nine tabs: Aerospike Expression Language (AEL) text on the Java SDK and Python SDK tabs, and the Exp builder on the other seven. See the AEL reference for AEL grammar.

Ops

bin_blob

bin_blob(name)
Description

Returns the bin named by name as a blob, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
blob
Introduced
5.2.0.4
Example

Records where blob bin checksum matches a 3-byte prefix (example digest bytes).

String exp = "$.checksum:BLOB == x'010203'";

bin_exists

bin_exists(name)
Description

Returns true if the record has a bin named name, otherwise false.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
boolean
Introduced
5.2.0.4
Example

Filter to records that have a quantity bin (any type).

String exp = "$.quantity.exists()";

bin_float

bin_float(name)
Description

Returns the bin named by name as a float, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
float
Introduced
5.2.0.4
Example

Records where float bin list_price is under 15 (bookstore-style pricing).

String exp = "$.list_price:FLOAT < 15.0";

bin_geo

bin_geo(name)
Description

Returns the bin named by name as a GeoJSON value, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
geojson
Introduced
5.2.0.4
Example

Records whose GeoJSON bin region contains the given point (same pattern as cmp_geo).

String exp = "geoCompare("
+ "geoJson('{\"type\":\"Point\",\"coordinates\":[-122.4,37.8]}'), $.region:GEO)";

bin_hll

bin_hll(name)
Description

Returns the bin named by name as an HLL, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
hll
Introduced
5.2.0.4
Example

Records where HLL bin visitors has a non-zero estimated cardinality, using HLLExp.getCount on the typed HLL bin.

String exp = "$.visitors:HLL.hllCount() > 0";

bin_int

bin_int(name)
Description

Returns the bin named by name as an integer, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
integer
Introduced
5.2.0.4
Example

Records where integer bin quantity is in stock (greater than zero).

String exp = "$.quantity:INT > 0";

bin_list

bin_list(name)
Description

Returns the bin named by name as a list, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
list
Introduced
5.2.0.4
Example

Records where list bin tags is non-empty, using the list bin value with a list read expression (size).

String exp = "$.tags:LIST.count() > 0";

bin_map

bin_map(name)
Description

Returns the bin named by name as a map, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
map
Introduced
5.2.0.4
Example

Records where map bin attrs has at least one entry, using MapExp.size on the typed map bin.

String exp = "$.attrs:MAP.count() > 0";

bin_str

bin_str(name)
Description

Returns the bin named by name as a string, or unknown if the bin does not exist or holds a different type.

Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
string
Introduced
5.2.0.4
Example

Records in the fiction category (string bin category).

String exp = "$.category:STRING == 'fiction'";

bin_type

bin_type(name)
Description

Returns the data type of the bin named by name, as an integer code, or 0 if the bin does not exist.

Compare the result against your client’s bin-type constants rather than writing the number directly. The codes are:

Bin data typeCode
Integer1
Double2
String3
Blob4
Boolean17
HyperLogLog18
Map19
List20
GeoJSON23
Arguments
NameTypeDescription
namestring literal

Name of the bin.

Returns
integer
Introduced
5.2.0.4
Example

Filter to records whose sku bin is stored as a string.

String exp = "$.sku.type() == STRING";

key_blob

key_blob()
Description

Returns the record’s user key as a blob, or unknown if the record has no stored key or the key is a different type.

Returns
blob
Introduced
5.2.0.4
Example

Records whose blob user key matches a short byte sequence (for example a binary id).

String exp = "$.key():BLOB == x'1020'";

key_int

key_int()
Description

Returns the record’s user key as an integer, or unknown if the record has no stored key or the key is a different type.

Returns
integer
Introduced
5.2.0.4
Example

Records whose integer user key is at least 1000 (same units as the key type).

String exp = "$.key():INT >= 1000";

key_str

key_str()
Description

Returns the record’s user key as a string, or unknown if the record has no stored key or the key is a different type.

Returns
string
Introduced
5.2.0.4
Example

Records whose string user key is order-42.

String exp = "$.key():STRING == 'order-42'";