All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
Expression Filters

Description

Expression filters are applied on each applicable server record. Expression filters require server version >= 5.2.0.4.

If the filter exists and evaluates to false in a single record transaction, the transaction is ignored and AEROSPIKE_FILTERED_OUT is returned as an error code.

If the filter exists and evaluates to false in a batch record row, AEROSPIKE_FILTERED_OUT is returned as a status for that record row in the batch.

If the filter exists and evaluates to false on a scan/query record, that record is not returned.

Expression filters can now be defined on all transactions through the transaction policy (as_policy_base contained in as_policy_read, as_policy_write, ...).

Example:

as_exp_build(filter,
p.filter_exp = filter;
...
as_exp_destroy(filter);

Macros

#define as_exp_abs(__value)   {.op=_AS_EXP_CODE_ABS, .count=2}, __value
 
#define as_exp_add(...)
 
#define as_exp_and(...)
 
#define as_exp_bin_blob(__bin_name)
 
#define as_exp_bin_bool(__bin_name)
 
#define as_exp_bin_exists(__bin_name)   as_exp_cmp_ne(as_exp_bin_type(__bin_name), as_exp_int(AS_BYTES_UNDEF))
 
#define as_exp_bin_float(__bin_name)
 
#define as_exp_bin_geo(__bin_name)
 
#define as_exp_bin_hll(__bin_name)
 
#define as_exp_bin_int(__bin_name)
 
#define as_exp_bin_list(__bin_name)
 
#define as_exp_bin_map(__bin_name)
 
#define as_exp_bin_str(__bin_name)
 
#define as_exp_bin_type(__bin_name)
 
#define as_exp_bit_add(__policy, __bit_offset, __bit_size, __value, __action, __bin)
 
#define as_exp_bit_and(__policy, __bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_count(__bit_offset, __bit_size, __bin)
 
#define as_exp_bit_get(__bit_offset, __bit_size, __bin)
 
#define as_exp_bit_get_int(__bit_offset, __bit_size, __sign, __bin)
 
#define as_exp_bit_insert(__policy, __byte_offset, __value, __bin)
 
#define as_exp_bit_lscan(__bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_lshift(__policy, __bit_offset, __bit_size, __shift, __bin)
 
#define as_exp_bit_not(__policy, __bit_offset, __bit_size, __bin)
 
#define as_exp_bit_or(__policy, __bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_remove(__policy, __byte_offset, __byte_size, __bin)
 
#define as_exp_bit_resize(__policy, __byte_size, __flags, __bin)
 
#define as_exp_bit_rscan(__bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_rshift(__policy, __bit_offset, __bit_size, __shift, __bin)
 
#define as_exp_bit_set(__policy, __bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_set_int(__policy, __bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bit_subtract(__policy, __bit_offset, __bit_size, __value, __action, __bin)
 
#define as_exp_bit_xor(__policy, __bit_offset, __bit_size, __value, __bin)
 
#define as_exp_bool(__val)   {.op=_AS_EXP_CODE_VAL_BOOL, .v.bool_val=__val}
 
#define as_exp_build(__name,...)
 
#define as_exp_build_b64(__name,...)
 
#define as_exp_bytes(__val, __size)   {.op=_AS_EXP_CODE_VAL_BYTES, .sz=__size, .v.bytes_val=__val}
 
#define as_exp_ceil(__num)   {.op=_AS_EXP_CODE_CEIL, .count=2}, __num
 
#define as_exp_cmp_eq(__left, __right)   {.op=_AS_EXP_CODE_CMP_EQ, .count=3}, __left, __right
 
#define as_exp_cmp_ge(__left, __right)   {.op=_AS_EXP_CODE_CMP_GE, .count=3}, __left, __right
 
#define as_exp_cmp_geo(__left, __right)   {.op=_AS_EXP_CODE_CMP_GEO, .count=3}, __left, __right
 
#define as_exp_cmp_gt(__left, __right)   {.op=_AS_EXP_CODE_CMP_GT, .count=3}, __left, __right
 
#define as_exp_cmp_le(__left, __right)   {.op=_AS_EXP_CODE_CMP_LE, .count=3}, __left, __right
 
#define as_exp_cmp_lt(__left, __right)   {.op=_AS_EXP_CODE_CMP_LT, .count=3}, __left, __right
 
#define as_exp_cmp_ne(__left, __right)   {.op=_AS_EXP_CODE_CMP_NE, .count=3}, __left, __right
 
#define as_exp_cmp_regex(__options, __regex_str, __cmp_str)
 
#define as_exp_cond(...)
 
#define as_exp_def(__var_name, __expr)   _AS_EXP_VAL_RAWSTR(__var_name), __expr
 
#define as_exp_device_size()   {.op=_AS_EXP_CODE_DEVICE_SIZE, .count=1}
 
#define as_exp_digest_modulo(__mod)
 
#define as_exp_div(...)
 
#define as_exp_exclusive(...)
 
#define as_exp_expr(__e)   {.op=_AS_EXP_CODE_MERGE, .v.expr=__e}
 
#define as_exp_float(__val)   {.op=_AS_EXP_CODE_VAL_FLOAT, .v.float_val=__val}
 
#define as_exp_floor(__num)   {.op=_AS_EXP_CODE_FLOOR, .count=2}, __num
 
#define as_exp_geo(__val)   {.op=_AS_EXP_CODE_VAL_GEO, .v.val=(as_val*)as_geojson_new(__val, false)}
 
#define as_exp_hll_add(__policy, __list, __index_bit_count, __bin)
 
#define as_exp_hll_add_mh(__policy, __list, __index_bit_count, __mh_bit_count, __bin)
 
#define as_exp_hll_describe(__bin)
 
#define as_exp_hll_get_count(__bin)
 
#define as_exp_hll_get_intersect_count(__list, __bin)
 
#define as_exp_hll_get_similarity(__list, __bin)
 
#define as_exp_hll_get_union(__list, __bin)
 
#define as_exp_hll_get_union_count(__list, __bin)
 
#define as_exp_hll_init(__policy, __index_bit_count, __bin)
 
#define as_exp_hll_init_mh(__policy, __index_bit_count, __mh_bit_count, __bin)
 
#define as_exp_hll_may_contain(__list, __bin)
 
#define as_exp_hll_update(__policy, __list, __bin)
 
#define as_exp_inf()   as_exp_val(&as_cmp_inf)
 
#define as_exp_int(__val)   {.op=_AS_EXP_CODE_VAL_INT, .v.int_val=__val}
 
#define as_exp_int_and(...)
 
#define as_exp_int_arshift(__value, __shift)   {.op=_AS_EXP_CODE_INT_ARSHIFT, .count=3}, __value, __shift
 
#define as_exp_int_count(__expr)   {.op=_AS_EXP_CODE_INT_COUNT, .count=2}, __expr
 
#define as_exp_int_lscan(__value, __search)   {.op=_AS_EXP_CODE_INT_LSCAN, .count=3}, __value, __search
 
#define as_exp_int_lshift(__value, __shift)   {.op=_AS_EXP_CODE_INT_LSHIFT, .count=3}, __value, __shift
 
#define as_exp_int_not(__expr)
 
#define as_exp_int_or(...)
 
#define as_exp_int_rscan(__value, __search)   {.op=_AS_EXP_CODE_INT_RSCAN, .count=3}, __value, __search
 
#define as_exp_int_rshift(__value, __shift)   {.op=_AS_EXP_CODE_INT_RSHIFT, .count=3}, __value, __shift
 
#define as_exp_int_xor(...)
 
#define as_exp_is_tombstone()   {.op=_AS_EXP_CODE_IS_TOMBSTONE, .count=1}
 
#define as_exp_key_blob()
 
#define as_exp_key_exist()   {.op=_AS_EXP_CODE_KEY_EXIST, .count=1}
 
#define as_exp_key_int()
 
#define as_exp_key_str()
 
#define as_exp_last_update()   {.op=_AS_EXP_CODE_LAST_UPDATE, .count=1}
 
#define as_exp_let(...)
 
#define as_exp_list_append(__ctx, __pol, __val, __bin)
 
#define as_exp_list_append_items(__ctx, __pol, __val, __bin)
 
#define as_exp_list_clear(__ctx, __bin)
 
#define as_exp_list_get_by_index(__ctx, __rtype, __vtype, __idx, __bin)
 
#define as_exp_list_get_by_index_range(__ctx, __rtype, __idx, __count, __bin)
 
#define as_exp_list_get_by_index_range_to_end(__ctx, __rtype, __idx, __bin)
 
#define as_exp_list_get_by_rank(__ctx, __rtype, __vtype, __rank, __bin)
 
#define as_exp_list_get_by_rank_range(__ctx, __rtype, __rank, __count, __bin)
 
#define as_exp_list_get_by_rank_range_to_end(__ctx, __rtype, __rank, __bin)
 
#define as_exp_list_get_by_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin)
 
#define as_exp_list_get_by_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin)
 
#define as_exp_list_get_by_value(__ctx, __rtype, __val, __bin)
 
#define as_exp_list_get_by_value_list(__ctx, __rtype, __val, __bin)
 
#define as_exp_list_get_by_value_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_list_increment(__ctx, __pol, __idx, __val, __bin)
 
#define as_exp_list_insert(__ctx, __pol, __idx, __val, __bin)
 
#define as_exp_list_insert_items(__ctx, __pol, __idx, __val, __bin)
 
#define as_exp_list_remove_by_index(__ctx, __idx, __bin)
 
#define as_exp_list_remove_by_index_range(__ctx, __rtype, __idx, __count, __bin)
 
#define as_exp_list_remove_by_index_range_to_end(__ctx, __rtype, __idx, __bin)
 
#define as_exp_list_remove_by_rank(__ctx, __rank, __bin)
 
#define as_exp_list_remove_by_rank_range(__ctx, __rtype, __rank, __count, __bin)
 
#define as_exp_list_remove_by_rank_range_to_end(__ctx, __rtype, __rank, __bin)
 
#define as_exp_list_remove_by_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin)
 
#define as_exp_list_remove_by_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin)
 
#define as_exp_list_remove_by_value(__ctx, __rtype, __val, __bin)
 
#define as_exp_list_remove_by_value_list(__ctx, __rtype, __values, __bin)
 
#define as_exp_list_remove_by_value_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_list_set(__ctx, __pol, __idx, __val, __bin)
 
#define as_exp_list_size(__ctx, __bin)
 
#define as_exp_list_sort(__ctx, __order, __bin)
 
#define as_exp_log(__num, __base)   {.op=_AS_EXP_CODE_LOG, .count=3}, __num, __base
 
#define as_exp_map_clear(__ctx, __bin)
 
#define as_exp_map_get_by_index(__ctx, __rtype, __vtype, __idx, __bin)
 
#define as_exp_map_get_by_index_range(__ctx, __rtype, __idx, __count, __bin)
 
#define as_exp_map_get_by_index_range_to_end(__ctx, __rtype, __idx, __bin)
 
#define as_exp_map_get_by_key(__ctx, __rtype, __vtype, __key, __bin)
 
#define as_exp_map_get_by_key_list(__ctx, __rtype, __keys, __bin)
 
#define as_exp_map_get_by_key_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_map_get_by_key_rel_index_range(__ctx, __rtype, __key, __idx, __count, __bin)
 
#define as_exp_map_get_by_key_rel_index_range_to_end(__ctx, __rtype, __key, __idx, __bin)
 
#define as_exp_map_get_by_rank(__ctx, __rtype, __vtype, __rank, __bin)
 
#define as_exp_map_get_by_rank_range(__ctx, __rtype, __rank, __count, __bin)
 
#define as_exp_map_get_by_rank_range_to_end(__ctx, __rtype, __rank, __bin)
 
#define as_exp_map_get_by_value(__ctx, __rtype, __val, __bin)
 
#define as_exp_map_get_by_value_list(__ctx, __rtype, __values, __bin)
 
#define as_exp_map_get_by_value_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_map_get_by_value_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin)
 
#define as_exp_map_get_by_value_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin)
 
#define as_exp_map_increment(__ctx, __pol, __key, __val, __bin)
 
#define as_exp_map_put(__ctx, __pol, __key, __val, __bin)
 
#define as_exp_map_put_items(__ctx, __pol, __map, __bin)
 
#define as_exp_map_remove_by_index(__ctx, __idx, __bin)
 
#define as_exp_map_remove_by_index_range(__ctx, __rtype, __idx, __count, __bin)
 
#define as_exp_map_remove_by_index_range_to_end(__ctx, __rtype, __idx, __bin)
 
#define as_exp_map_remove_by_key(__ctx, __key, __bin)
 
#define as_exp_map_remove_by_key_list(__ctx, __rtype, __keys, __bin)
 
#define as_exp_map_remove_by_key_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_map_remove_by_key_rel_index_range(__ctx, __rtype, __key, __idx, __count, __bin)
 
#define as_exp_map_remove_by_key_rel_index_range_to_end(__ctx, __rtype, __key, __idx, __bin)
 
#define as_exp_map_remove_by_rank(__ctx, __rank, __bin)
 
#define as_exp_map_remove_by_rank_range(__ctx, __rtype, __rank, __count, __bin)
 
#define as_exp_map_remove_by_rank_range_to_end(__ctx, __rtype, __rank, __bin)
 
#define as_exp_map_remove_by_value(__ctx, __rtype, __val, __bin)
 
#define as_exp_map_remove_by_value_list(__ctx, __rtype, __values, __bin)
 
#define as_exp_map_remove_by_value_range(__ctx, __rtype, __begin, __end, __bin)
 
#define as_exp_map_remove_by_value_rel_rank_range(__ctx, __rtype, __val, __rank, __count, __bin)
 
#define as_exp_map_remove_by_value_rel_rank_range_to_end(__ctx, __rtype, __val, __rank, __bin)
 
#define as_exp_map_size(__ctx, __bin)
 
#define as_exp_max(...)
 
#define as_exp_memory_size()   {.op=_AS_EXP_CODE_MEMORY_SIZE, .count=1}
 
#define as_exp_min(...)
 
#define as_exp_mod(__numerator, __denominator)   {.op=_AS_EXP_CODE_MOD, .count=3}, __numerator, __denominator
 
#define as_exp_mul(...)
 
#define as_exp_nil()   as_exp_val(&as_nil)
 
#define as_exp_not(__expr)   {.op=_AS_EXP_CODE_NOT, .count=2}, __expr
 
#define as_exp_or(...)
 
#define as_exp_pow(__base, __exponent)   {.op=_AS_EXP_CODE_POW, .count=3}, __base, __exponent
 
#define as_exp_record_size()   {.op=_AS_EXP_CODE_RECORD_SIZE, .count=1}
 
#define as_exp_set_name()   {.op=_AS_EXP_CODE_SET_NAME, .count=1}
 
#define as_exp_since_update()   {.op=_AS_EXP_CODE_SINCE_UPDATE, .count=1}
 
#define as_exp_str(__val)   {.op=_AS_EXP_CODE_VAL_STR, .v.str_val=__val}
 
#define as_exp_sub(...)
 
#define as_exp_to_float(__num)   {.op=_AS_EXP_CODE_TO_FLOAT, .count=2}, __num
 
#define as_exp_to_int(__num)   {.op=_AS_EXP_CODE_TO_INT, .count=2}, __num
 
#define as_exp_ttl()   {.op=_AS_EXP_CODE_TTL, .count=1}
 
#define as_exp_uint(__val)   {.op=_AS_EXP_CODE_VAL_UINT, .v.uint_val=__val}
 
#define as_exp_unknown()   {.op=_AS_EXP_CODE_UNKNOWN, .count=1}
 
#define as_exp_val(__val)   {.op=_AS_EXP_CODE_AS_VAL, .v.val=(as_val*)(__val)}
 
#define as_exp_var(__var_name)   {.op=_AS_EXP_CODE_VAR, .count=2}, _AS_EXP_VAL_RAWSTR(__var_name)
 
#define as_exp_void_time()   {.op=_AS_EXP_CODE_VOID_TIME, .count=1}
 
#define as_exp_wildcard()   as_exp_val(&as_cmp_wildcard)
 

Functions

AS_EXTERN void as_exp_destroy (as_exp *exp)
 
static void as_exp_destroy_base64 (char *base64)
 
AS_EXTERN as_expas_exp_from_base64 (const char *base64)
 
static char * as_exp_to_base64 (as_exp *exp)
 

Macro Definition Documentation

#define as_exp_abs (   __value)    {.op=_AS_EXP_CODE_ABS, .count=2}, __value

Create operator that returns absolute value of a number. All arguments must resolve to integer or float. Requires server version 5.6.0+.

// abs(a) == 1
as_exp_build(expression,
as_exp_int(1)));
Returns
(number value)

Definition at line 1215 of file as_exp.h.

#define as_exp_add (   ...)
Value:
{.op=_AS_EXP_CODE_ADD}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// a + b + c == 10
as_exp_build(expression,
as_exp_int(10)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1070 of file as_exp.h.

#define as_exp_and (   ...)
Value:
{.op=_AS_EXP_CODE_AND}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create "and" (&&) operator that applies to a variable number of expressions.

Parameters
...Variable number of boolean expressions.
Returns
(boolean value)

Definition at line 1008 of file as_exp.h.

#define as_exp_bin_blob (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a blob. Returns 'unknown' if the bin is not an blob.

// Integer bin "a" == { 0x65, 0x65 }
uint8_t val[] = {0x65, 0x65}
as_exp_build(expression,
as_exp_cmp_eq(as_exp_bin_blob("a"), as_exp_bytes(val, sizeof(val))));
Parameters
__bin_nameBin name.
Returns
(blob bin)

Definition at line 537 of file as_exp.h.

#define as_exp_bin_bool (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a boolean value. Returns 'unknown' if the bin is not a boolean.

// Check if the value in bin "a" is true.
as_exp_build(expression, as_exp_bin_bool("a"));
Parameters
__bin_nameBin name.
Returns
(boolean bin)

Definition at line 460 of file as_exp.h.

#define as_exp_bin_exists (   __bin_name)    as_exp_cmp_ne(as_exp_bin_type(__bin_name), as_exp_int(AS_BYTES_UNDEF))

Create expression that returns if bin of specified name exists.

// Bin "a" exists in record.
as_exp_build(expression, as_exp_bin_exists("a"));
Parameters
__bin_nameBin name.
Returns
(boolean value) True if the bin exists, false otherwise.

Definition at line 635 of file as_exp.h.

#define as_exp_bin_float (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a float. Returns 'unknown' if the bin is not an float.

// Float bin "a" >= 2.71
as_exp_build(expression,
Parameters
__bin_nameBin name.
Returns
(float bin)

Definition at line 498 of file as_exp.h.

#define as_exp_bin_geo (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a geojson. Returns 'unknown' if the bin is not geojson.

// GeoJSON bin "a" contained by GeoJSON bin "b"
as_exp_build(expression,
Parameters
__bin_nameBin name.
Returns
(geojson bin)

Definition at line 556 of file as_exp.h.

#define as_exp_bin_hll (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a HyperLogLog (hll). Returns 'unknown' if the bin is not a HyperLogLog (hll).

// HLL bin "a" have an hll_count > 1000000
as_exp_build(expression,
as_exp_int(1000000)));
Parameters
__bin_nameBin name.
Returns
(hll bin)

Definition at line 618 of file as_exp.h.

#define as_exp_bin_int (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a signed integer. Returns 'unknown' if the bin is not an integer.

// Integer bin "a" == 200
as_exp_build(expression,
Parameters
__bin_nameBin name.
Returns
(integer bin)

Definition at line 479 of file as_exp.h.

#define as_exp_bin_list (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a list. Returns 'unknown' if the bin is not an list.

// List bin "a" contains at least one item == "abc"
as_exp_build(filter,
as_exp_str("abc"), as_exp_bin_list("a")),
as_exp_int(0)));
Parameters
__bin_nameBin name.
Returns
(list bin)

Definition at line 578 of file as_exp.h.

#define as_exp_bin_map (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a map. Returns 'unknown' if the bin is not an map.

// Map bin "a" size > 7.
as_exp_build(expression,
as_exp_int(7)));
Parameters
__bin_nameBin name.
Returns
(map bin)

Definition at line 598 of file as_exp.h.

#define as_exp_bin_str (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN, .count=3}, \
_AS_EXP_VAL_RAWSTR(__bin_name)
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns a bin as a string. Returns 'unknown' if the bin is not an string.

// String bin "a" == "b"
as_exp_build(expression,
Parameters
__bin_nameBin name.
Returns
(string bin)

Definition at line 517 of file as_exp.h.

#define as_exp_bin_type (   __bin_name)
Value:
{.op=_AS_EXP_CODE_BIN_TYPE, .count=2}, \
_AS_EXP_VAL_RAWSTR(__bin_name)

Create expression that returns the type of a bin as a integer.

// bin "a" == type.string
as_exp_build(expression,
Parameters
__bin_nameBin name.
Returns
(integer value) returns the bin_type as an as_bytes_type.

Definition at line 651 of file as_exp.h.

#define as_exp_bit_add (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __action,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_ADD, 5), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
as_exp_uint(__action), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_add operation. Note: integers are stored big-endian.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__valueInteger expression for value to add.
__actionas_bit_overflow_action value.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3065 of file as_exp.h.

#define as_exp_bit_and (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_AND, 4), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_and operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__valueBlob expression containing bytes to write.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 2989 of file as_exp.h.

#define as_exp_bit_count (   __bit_offset,
  __bit_size,
  __bin 
)
Value:
_AS_EXP_BIT_READ_START(AS_EXP_TYPE_INT, AS_BIT_OP_COUNT, 2), \
__bit_offset, \
__bit_size, \
__bin

Create an expression that performs an as_operations_bit_count operation.

Parameters
__bit_offsetThe bit index of where to start reading from.
__bit_sizeNumber of bits to read from the blob bin.
__binA blob bin expression to apply this function to.
Returns
(integer value) number of bits set to 1 in the bit_size region.

Definition at line 3154 of file as_exp.h.

#define as_exp_bit_get (   __bit_offset,
  __bit_size,
  __bin 
)
Value:
_AS_EXP_BIT_READ_START(AS_EXP_TYPE_BLOB, AS_BIT_OP_GET, 2), \
__bit_offset, \
__bit_size, \
__bin

Create an expression that performs an as_operations_bit_get operation.

Parameters
__bit_offsetThe bit index of where to start reading from.
__bit_sizeNumber of bits to read from the blob bin.
__binA blob bin expression to apply this function to.
Returns
(blob bin) bit_size bits rounded up to the nearest byte size.

Definition at line 3139 of file as_exp.h.

#define as_exp_bit_get_int (   __bit_offset,
  __bit_size,
  __sign,
  __bin 
)
Value:
_AS_EXP_BIT_READ_START(AS_EXP_TYPE_INT, AS_BIT_OP_GET_INT, 3), \
__bit_offset, \
__bit_size, \
as_exp_int(__sign ? 1 : 0), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create an expression that performs an as_operations_bit_get_int operation.

Parameters
__bit_offsetThe bit index of where to start reading from.
__bit_sizeNumber of bits to read from the blob bin.
__signBoolean value, true for signed, false for unsigned.
__binA blob bin expression to apply this function to.
Returns
(integer value) Index of the left most bit starting from __offset set to __value.

Definition at line 3204 of file as_exp.h.

#define as_exp_bit_insert (   __policy,
  __byte_offset,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_INSERT, 3), \
__byte_offset, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_insert operation.

Parameters
__policyAn as_bit_policy value.
__byte_offsetByte index of where to insert the value.
__valueBlob expression containing the bytes to insert.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob containing the inserted bytes.

Definition at line 2897 of file as_exp.h.

#define as_exp_bit_lscan (   __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_READ_START(AS_EXP_TYPE_INT, AS_BIT_OP_LSCAN, 3), \
__bit_offset, \
__bit_size, \
__value, \
__bin

Create an expression that performs an as_operations_bit_lscan operation.

Parameters
__bit_offsetThe bit index of where to start reading from.
__bit_sizeNumber of bits to read from the blob bin.
__valueBoolean expression, true searches for 1, false for 0.
__binA blob bin expression to apply this function to.
Returns
(integer value) Index of the left most bit starting from __offset set to __value.

Definition at line 3170 of file as_exp.h.

#define as_exp_bit_lshift (   __policy,
  __bit_offset,
  __bit_size,
  __shift,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_LSHIFT, 4), \
__bit_offset, \
__bit_size, \
__shift, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_lshift operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__shiftNumber of bits to shift by.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3025 of file as_exp.h.

#define as_exp_bit_not (   __policy,
  __bit_offset,
  __bit_size,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_NOT, 3), \
__bit_offset, \
__bit_size, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_not operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3007 of file as_exp.h.

#define as_exp_bit_or (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_OR, 4), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_or operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bytes to be operated on.
__valueBlob expression containing bytes to write.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 2951 of file as_exp.h.

#define as_exp_bit_remove (   __policy,
  __byte_offset,
  __byte_size,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_REMOVE, 3), \
__byte_offset, \
__byte_size, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_remove operation.

Parameters
__policyAn as_bit_policy value.
__byte_offsetByte index of where to remove from.
__byte_sizeNumber of bytes to remove.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes removed.

Definition at line 2914 of file as_exp.h.

#define as_exp_bit_resize (   __policy,
  __byte_size,
  __flags,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_RESIZE, 3), \
__byte_size, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
as_exp_uint(__flags), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_resize operation.

Parameters
__policyAn as_bit_policy value.
__byte_sizeNumber of bytes the resulting blob should occupy.
__flagsas_bit_resize_flags value.
__binA blob bin expression to apply this function to.
Returns
(blob bin) __byte_size bytes.

Definition at line 2880 of file as_exp.h.

#define as_exp_bit_rscan (   __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_READ_START(AS_EXP_TYPE_INT, AS_BIT_OP_RSCAN, 3), \
__bit_offset, \
__bit_size, \
__value, \
__bin

Create an expression that performs an as_operations_bit_rscan operation.

Parameters
__bit_offsetThe bit index of where to start reading from.
__bit_sizeNumber of bits to read from the blob bin.
__valueBoolean expression, true searches for 1, false for 0.
__binA blob bin expression to apply this function to.
Returns
(integer value) Index of the right most bit starting from __offset set to __value.

Definition at line 3187 of file as_exp.h.

#define as_exp_bit_rshift (   __policy,
  __bit_offset,
  __bit_size,
  __shift,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_RSHIFT, 4), \
__bit_offset, \
__bit_size, \
__shift, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_rshift operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__shiftNumber of bits to shift by.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3044 of file as_exp.h.

#define as_exp_bit_set (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_SET, 4), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_set operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start writing.
__bit_sizeNumber of bytes to overwrite.
__valueBlob expression containing bytes to write.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes overwritten.

Definition at line 2932 of file as_exp.h.

#define as_exp_bit_set_int (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_SET_INT, 4), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_add operation. Note: integers are stored big-endian.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__valueInteger expression for value to set.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3108 of file as_exp.h.

#define as_exp_bit_subtract (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __action,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_SUBTRACT, 5), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
as_exp_uint(__action), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_add operation. Note: integers are stored big-endian.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__valueInteger expression for value to subtract.
__actionas_bit_overflow_action value.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 3087 of file as_exp.h.

#define as_exp_bit_xor (   __policy,
  __bit_offset,
  __bit_size,
  __value,
  __bin 
)
Value:
_AS_EXP_BIT_MOD_START(AS_BIT_OP_XOR, 4), \
__bit_offset, \
__bit_size, \
__value, \
as_exp_uint(__policy ? ((as_bit_policy*)(__policy))->flags : 0), \
__bin
#define as_exp_uint(__val)
Definition: as_exp.h:312

Create an expression that performs an as_operations_bit_xor operation.

Parameters
__policyAn as_bit_policy value.
__bit_offsetBit index of where to start operation.
__bit_sizeNumber of bits to be operated on.
__valueBlob expression containing bytes to write.
__binA blob bin expression to apply this function to.
Returns
(blob bin) resulting blob with the bytes operated on.

Definition at line 2970 of file as_exp.h.

#define as_exp_bool (   __val)    {.op=_AS_EXP_CODE_VAL_BOOL, .v.bool_val=__val}

Create boolean value.

Parameters
__valboolean value.

Definition at line 296 of file as_exp.h.

#define as_exp_build (   __name,
  ... 
)
Value:
as_exp* __name; \
do { \
as_exp_entry __table__[] = { __VA_ARGS__ }; \
__name = as_exp_compile(__table__, sizeof(__table__) / sizeof(as_exp_entry)); \
} while (false)
AS_EXTERN as_exp * as_exp_compile(as_exp_entry *table, uint32_t n)
Definition: as_exp.h:182
Definition: as_exp.h:187

Declare and build an expression variable.

// a == 10
as_exp_build(expression,
...
as_exp_destroy(expression);
Parameters
__nameName of the variable to hold the expression

Definition at line 3457 of file as_exp.h.

#define as_exp_build_b64 (   __name,
  ... 
)
Value:
char* __name; \
do { \
as_exp_entry __table__[] = { __VA_ARGS__ }; \
as_exp* temp = as_exp_compile(__table__, sizeof(__table__) / sizeof(as_exp_entry)); \
__name = as_exp_compile_b64(temp); \
} while (false)
AS_EXTERN as_exp * as_exp_compile(as_exp_entry *table, uint32_t n)
AS_EXTERN char * as_exp_compile_b64(as_exp *exp)
AS_EXTERN void as_exp_destroy(as_exp *exp)
Definition: as_exp.h:187

Declare and build an base64 packed expression variable.

// a == 10
as_exp_build_b64(expression,
...
as_exp_destroy_b64(expression);
Parameters
__nameName of the variable to hold the expression

Definition at line 3478 of file as_exp.h.

#define as_exp_bytes (   __val,
  __size 
)    {.op=_AS_EXP_CODE_VAL_BYTES, .sz=__size, .v.bytes_val=__val}

Create byte array value.

Parameters
__valbyte array value.
__sizenumber of bytes.

Definition at line 337 of file as_exp.h.

#define as_exp_ceil (   __num)    {.op=_AS_EXP_CODE_CEIL, .count=2}, __num

Create expression that rounds a floating point number up to the closest integer value. Requires server version 5.6.0+.

// ceil(2.15) == 3.0
as_exp_build(expression,
as_exp_float(3.0)));
Parameters
__numFloating point value to round up.
Returns
(integer-value)

Definition at line 1253 of file as_exp.h.

#define as_exp_cmp_eq (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_EQ, .count=3}, __left, __right

Create equals (==) expression.

// Integer bin "a" == 11.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 847 of file as_exp.h.

#define as_exp_cmp_ge (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_GE, .count=3}, __left, __right

Create a greater than or equals (>=) expression.

// Integer bin "a" >= 88.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 896 of file as_exp.h.

#define as_exp_cmp_geo (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_GEO, .count=3}, __left, __right

Create a point within region or region contains point expression.

// Geo bin "point" is within geo bin "region".
as_exp_build(expression,
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 967 of file as_exp.h.

#define as_exp_cmp_gt (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_GT, .count=3}, __left, __right

Create a greater than (>) expression.

// Integer bin "a" > 8.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 880 of file as_exp.h.

#define as_exp_cmp_le (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_LE, .count=3}, __left, __right

Create a less than or equals (<=) expression.

// Integer bin "a" <= 1.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 928 of file as_exp.h.

#define as_exp_cmp_lt (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_LT, .count=3}, __left, __right

Create a less than (<) expression.

// Integer bin "a" < 1000.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 912 of file as_exp.h.

#define as_exp_cmp_ne (   __left,
  __right 
)    {.op=_AS_EXP_CODE_CMP_NE, .count=3}, __left, __right

Create not equal (!=) expression.

// Integer bin "a" != 13.
Parameters
__leftleft expression in comparison.
__rightright expression in comparison.
Returns
(boolean value)

Definition at line 864 of file as_exp.h.

#define as_exp_cmp_regex (   __options,
  __regex_str,
  __cmp_str 
)
Value:
{.op=_AS_EXP_CODE_CMP_REGEX, .count=4}, \
as_exp_int(__options), _AS_EXP_VAL_RAWSTR(__regex_str), \
__cmp_str
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that performs a regex match on a string bin or value expression.

// Select string bin "a" that starts with "prefix" and ends with "suffix".
// Ignore case and do not match newline.
as_exp_build(expression,
as_exp_cmp_regex(REG_ICASE | REG_NEWLINE, as_exp_str("prefix.*suffix"), as_exp_bin_str("a")));
Parameters
__optionsPOSIX regex flags defined in regex.h.
__regex_strPOSIX regex string.
__cmp_strString expression to compare against.
Returns
(boolean value)

Definition at line 948 of file as_exp.h.

#define as_exp_cond (   ...)
Value:
{.op=_AS_EXP_CODE_COND}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Conditionally select an expression from a variable number of expression pairs followed by default expression action. Requires server version 5.6.0+.

Args Format: bool exp1, action exp1, bool exp2, action exp2, ..., action-default
// Apply operator based on type and test if greater than 100
as_exp_build(expression,
as_exp_eq(as_exp_bin_int("type"), as_exp_int(0)),
as_exp_eq(as_exp_bin_int("type"), as_exp_int(1)),
as_exp_eq(as_exp_bin_int("type"), as_exp_int(2)),
as_exp_int(-1)),
as_exp_int(100)));
Returns
first action expression where bool expression is true or action-default.

Definition at line 1563 of file as_exp.h.

#define as_exp_def (   __var_name,
  __expr 
)    _AS_EXP_VAL_RAWSTR(__var_name), __expr

Assign variable to an expression that can be accessed later. Requires server version 5.6.0+.

// 5 < a < 10
as_exp_build(expression,
as_exp_lt(as_exp_int(5), as_exp_var("x")),
as_exp_lt(as_exp_var("x"), as_exp_int(10)))));
Parameters
__var_nameVariable name.
__exprThe variable is set to the result of __expr.
Returns
A variable name expression pair.

Definition at line 1606 of file as_exp.h.

#define as_exp_device_size ( )    {.op=_AS_EXP_CODE_DEVICE_SIZE, .count=1}

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.

This expression should only be used for server versions less than 7.0. Use as_exp_record_size() for server version 7.0+.

// Record device size >= 100 KB
as_exp_build(expression,
Returns
(integer value) Uncompressed storage size of the record.

Definition at line 709 of file as_exp.h.

#define as_exp_digest_modulo (   __mod)
Value:
{.op=_AS_EXP_CODE_DIGEST_MODULO, .count=2}, \
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns record digest modulo as integer.

// Records that have digest(key) % 3 == 1
as_exp_build(expression,
Parameters
__modDivisor used to divide the digest to get a remainder.
Returns
(integer value) Value in range 0 and mod (exclusive)..

Definition at line 826 of file as_exp.h.

#define as_exp_div (   ...)
Value:
{.op=_AS_EXP_CODE_DIV}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// a / b / c == 1
as_exp_build(expression,
as_exp_int(1)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1135 of file as_exp.h.

#define as_exp_exclusive (   ...)
Value:
{.op=_AS_EXP_CODE_EXCLUSIVE}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create expression that returns true if only one of the expressions are true. Requires server version 5.6.0+.

// exclusive(a == 0, b == 0)
as_exp_build(expression,
Parameters
...Variable number of boolean expressions.
Returns
(boolean value)

Definition at line 1045 of file as_exp.h.

#define as_exp_expr (   __e)    {.op=_AS_EXP_CODE_MERGE, .v.expr=__e}

Merge precompiled expression into a new expression tree. Useful for storing common precompiled expressions and then reusing these expressions as part of a greater expression.

// Merge precompiled expression into new expression.
as_exp_build(merged,
as_exp_expr(expr),
Parameters
__ePre-compiled expression.

Definition at line 3436 of file as_exp.h.

#define as_exp_float (   __val)    {.op=_AS_EXP_CODE_VAL_FLOAT, .v.float_val=__val}

Create 64 bit floating point value.

Parameters
__valfloating point value.

Definition at line 320 of file as_exp.h.

#define as_exp_floor (   __num)    {.op=_AS_EXP_CODE_FLOOR, .count=2}, __num

Create expression that rounds a floating point number down to the closest integer value. Requires server version 5.6.0+.

// floor(2.95) == 2.0
as_exp_build(expression,
as_exp_float(2.0)));
Parameters
__numFloating point value to round down.
Returns
(float-value)

Definition at line 1234 of file as_exp.h.

#define as_exp_geo (   __val)    {.op=_AS_EXP_CODE_VAL_GEO, .v.val=(as_val*)as_geojson_new(__val, false)}

Create geojson value.

Parameters
__valgeojson value.

Definition at line 345 of file as_exp.h.

#define as_exp_hll_add (   __policy,
  __list,
  __index_bit_count,
  __bin 
)
Value:
_AS_EXP_HLL_MOD_START(AS_HLL_OP_ADD, 4), \
__list, \
as_exp_int(__index_bit_count), \
as_exp_int(__policy == NULL ? 0 : ((as_hll_policy*)__policy)->flags), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create an expression that performs an as_operations_hll_add.

Parameters
__policyAn as_hll_policy value.
__listA list expression of elements to add to the HLL.
__index_bit_countNumber of index bits. Must be between 4 and 16 inclusive.
__binA bin expression to apply this function to.
Returns
(hll bin) Returns the resulting hll bin after adding elements from __list.

Definition at line 3288 of file as_exp.h.

#define as_exp_hll_add_mh (   __policy,
  __list,
  __index_bit_count,
  __mh_bit_count,
  __bin 
)
Value:
_AS_EXP_HLL_MOD_START(AS_HLL_OP_ADD, 4), \
__list, \
as_exp_int(__index_bit_count), \
as_exp_int(__mh_bit_count), \
as_exp_int(__policy == NULL ? 0 : ((as_hll_policy*)__policy)->flags), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create an expression that performs an as_operations_hll_add_mh.

Parameters
__policyAn as_hll_policy value.
__listA list expression of elements to add to the HLL.
__index_bit_countNumber of index bits. Must be between 4 and 16 inclusive.
__mh_bit_countNumber of min hash bits. Must be between 4 and 51 inclusive. Also, __index_bit_count + __mh_bit_count must be <= 64.
__binA bin expression to apply this function to.
Returns
(hll bin) Returns the resulting hll bin after adding elements from __list.

Definition at line 3270 of file as_exp.h.

#define as_exp_hll_describe (   __bin)
Value:

Create an expression that performs an as_operations_hll_describe.

Parameters
__binA bin expression to apply this function to.
Returns
(list bin) A list containing the index_bit_count and minhash_bit_count.

Definition at line 3397 of file as_exp.h.

#define as_exp_hll_get_count (   __bin)
Value:
_AS_EXP_HLL_READ_START(AS_EXP_TYPE_INT, AS_HLL_OP_COUNT, 0), \
__bin

Create an expression that performs an as_operations_hll_get_count.

Parameters
__binA bin expression to apply this function to.
Returns
(integer bin) The estimated number of unique elements in an HLL.

Definition at line 3334 of file as_exp.h.

#define as_exp_hll_get_intersect_count (   __list,
  __bin 
)
Value:

Create an expression that performs an as_operations_hll_get_inersect_count.

Parameters
__listA list expression of HLLs to intersect with.
__binA bin expression to apply this function to.
Returns
(integer bin) Estimated number of elements in the set intersection.

Definition at line 3372 of file as_exp.h.

#define as_exp_hll_get_similarity (   __list,
  __bin 
)
Value:
_AS_EXP_HLL_READ_START(AS_EXP_TYPE_FLOAT, AS_HLL_OP_SIMILARITY, 1), \
__list, \
__bin

Create an expression that performs an as_operations_hll_get_similarity.

Parameters
__listA list expression of HLLs to calculate similarity with..
__binA bin expression to apply this function to.
Returns
(float bin) Estimated similarity between 0.0 and 1.0.

Definition at line 3385 of file as_exp.h.

#define as_exp_hll_get_union (   __list,
  __bin 
)
Value:
_AS_EXP_HLL_READ_START(AS_EXP_TYPE_HLL, AS_HLL_OP_GET_UNION, 1), \
__list, \
__bin

Create an expression that performs an as_operations_hll_get_union.

Parameters
__listA list expression of HLLs to union with.
__binA bin expression to apply this function to.
Returns
(hll bin) HLL bin representing the set union.

Definition at line 3346 of file as_exp.h.

#define as_exp_hll_get_union_count (   __list,
  __bin 
)
Value:
_AS_EXP_HLL_READ_START(AS_EXP_TYPE_INT, AS_HLL_OP_UNION_COUNT, 1), \
__list, \
__bin

Create an expression that performs an as_operations_hll_get_union_count.

Parameters
__listA list expression of HLLs to union with.
__binA bin expression to apply this function to.
Returns
(integer bin) Estimated number of elements in the set union.

Definition at line 3359 of file as_exp.h.

#define as_exp_hll_init (   __policy,
  __index_bit_count,
  __bin 
)
Value:
_AS_EXP_HLL_MOD_START(AS_HLL_OP_INIT, 2), \
as_exp_int(__index_bit_count), \
as_exp_int(__policy == NULL ? 0 : ((as_hll_policy*)__policy)->flags), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that creates a new HLL or resets an existing HLL.

Parameters
__policyAn as_hll_policy value.
__index_bit_countNumber of index bits. Must be between 4 and 16 inclusive.
__binA bin expression to apply this function to.
Returns
(hll bin) Returns the resulting hll bin.

Definition at line 3252 of file as_exp.h.

#define as_exp_hll_init_mh (   __policy,
  __index_bit_count,
  __mh_bit_count,
  __bin 
)
Value:
_AS_EXP_HLL_MOD_START(AS_HLL_OP_INIT, 3), \
as_exp_int(__index_bit_count), \
as_exp_int(__mh_bit_count), \
as_exp_int(__policy == NULL ? 0 : ((as_hll_policy*)__policy)->flags), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that creates a new HLL or resets an existing HLL with minhash bits.

Parameters
__policyAn as_hll_policy value.
__index_bit_countNumber of index bits. Must be between 4 and 16 inclusive.
__mh_bit_countNumber of min hash bits. Must be between 4 and 51 inclusive. Also, __index_bit_count + __mh_bit_count must be <= 64.
__binA bin expression to apply this function to.
Returns
(hll bin) Returns the resulting hll bin.

Definition at line 3236 of file as_exp.h.

#define as_exp_hll_may_contain (   __list,
  __bin 
)
Value:
_AS_EXP_HLL_READ_START(AS_EXP_TYPE_INT, AS_HLL_OP_MAY_CONTAIN, 1), \
__list, \
__bin

Create an expression that checks if the HLL __bin may contain all keys in __list..

Parameters
__listA list expression of keys to check if the HLL may contain them.
__binA bin expression to apply this function to.
Returns
(integer bin) 1 __bin may contain all of __list, 0 otherwise.

Definition at line 3410 of file as_exp.h.

#define as_exp_hll_update (   __policy,
  __list,
  __bin 
)
Value:
_AS_EXP_HLL_MOD_START(AS_HLL_OP_ADD, 4), \
__list, \
as_exp_int(__policy == NULL ? 0 : ((as_hll_policy*)__policy)->flags), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create an expression that performs an as_operations_hll_update.

Parameters
__policyAn as_hll_policy value.
__listA list expression of elements to add to the HLL.
__binA bin expression to apply this function to.
Returns
(hll bin) Returns the resulting hll bin after adding elements from __list.

Definition at line 3305 of file as_exp.h.

#define as_exp_inf ( )    as_exp_val(&as_cmp_inf)

Create infinity value.

Definition at line 365 of file as_exp.h.

#define as_exp_int (   __val)    {.op=_AS_EXP_CODE_VAL_INT, .v.int_val=__val}

Create 64 bit signed integer value.

Parameters
__valinteger value.

Definition at line 304 of file as_exp.h.

#define as_exp_int_and (   ...)
Value:
{.op=_AS_EXP_CODE_INT_AND}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create integer "and" (&) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.

// a & 0xff == 0x11
as_exp_build(expression,
as_exp_int(0x11)));
Parameters
...Variable number of integer expressions.
Returns
(integer value)

Definition at line 1311 of file as_exp.h.

#define as_exp_int_arshift (   __value,
  __shift 
)    {.op=_AS_EXP_CODE_INT_ARSHIFT, .count=3}, __value, __shift

Create integer "arithmetic right shift" (>>) operator. Requires server version 5.6.0+.

// a >> 8 > 0xff
as_exp_build(expression,
as_exp_int(0xff)));
Parameters
__valueInteger expression.
__shiftNumber of bits to shift by.
Returns
(integer value)

Definition at line 1430 of file as_exp.h.

#define as_exp_int_count (   __expr)    {.op=_AS_EXP_CODE_INT_COUNT, .count=2}, __expr

Create expression that returns count of integer bits that are set to 1. Requires server version 5.6.0+.

// count(a) == 4
as_exp_build(expression,
as_exp_int(4)));
Returns
(integer value)

Definition at line 1448 of file as_exp.h.

#define as_exp_int_lscan (   __value,
  __search 
)    {.op=_AS_EXP_CODE_INT_LSCAN, .count=3}, __value, __search

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

// lscan(a, true) == 4
as_exp_build(expression,
as_exp_int(4)));
Returns
(integer value)

Definition at line 1470 of file as_exp.h.

#define as_exp_int_lshift (   __value,
  __shift 
)    {.op=_AS_EXP_CODE_INT_LSHIFT, .count=3}, __value, __shift

Create integer "left shift" (<<) operator. Requires server version 5.6.0+.

// a << 8 > 0xff
as_exp_build(expression,
as_exp_int(0xff)));
Parameters
__valueInteger expression.
__shiftNumber of bits to shift by.
Returns
(integer value)

Definition at line 1390 of file as_exp.h.

#define as_exp_int_not (   __expr)
Value:
{.op=_AS_EXP_CODE_INT_NOT, .count=2}, \
__expr

Create integer "not" (~) operator. Requires server version 5.6.0+.

// ~a == 7
as_exp_build(expression,
as_exp_int(7)));
Parameters
__exprInteger expression.
Returns
(integer value)

Definition at line 1370 of file as_exp.h.

#define as_exp_int_or (   ...)
Value:
{.op=_AS_EXP_CODE_INT_OR}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create integer "or" (|) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.

// a | 0x10 != 0
as_exp_build(expression,
as_exp_int(0)));
Parameters
...Variable number of integer expressions.
Returns
(integer value)

Definition at line 1331 of file as_exp.h.

#define as_exp_int_rscan (   __value,
  __search 
)    {.op=_AS_EXP_CODE_INT_RSCAN, .count=3}, __value, __search

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

// rscan(a, true) == 4
as_exp_build(expression,
as_exp_int(4)));
Returns
(integer value)

Definition at line 1492 of file as_exp.h.

#define as_exp_int_rshift (   __value,
  __shift 
)    {.op=_AS_EXP_CODE_INT_RSHIFT, .count=3}, __value, __shift

Create integer "logical right shift" (>>>) operator. Requires server version 5.6.0+.

// a >>> 8 > 0xff
as_exp_build(expression,
as_exp_int(0xff)));
Parameters
__valueInteger expression.
__shiftNumber of bits to shift by.
Returns
(integer value)

Definition at line 1410 of file as_exp.h.

#define as_exp_int_xor (   ...)
Value:
{.op=_AS_EXP_CODE_INT_XOR}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create integer "xor" (^) operator that is applied to two or more integers. All arguments must resolve to integers. Requires server version 5.6.0+.

// a ^ b == 16
as_exp_build(expression,
as_exp_int(16)));
Parameters
...Variable number of integer expressions.
Returns
(integer value)

Definition at line 1351 of file as_exp.h.

#define as_exp_is_tombstone ( )    {.op=_AS_EXP_CODE_IS_TOMBSTONE, .count=1}

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.

Note - this is only useful for XDR filters.

// Deleted records that are in tombstone state.
Returns
(boolean value) True if the record is a tombstone, false otherwise.

Definition at line 791 of file as_exp.h.

#define as_exp_key_blob ( )
Value:
{.op=_AS_EXP_CODE_KEY, .count=2}, \
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns the key as an blob. Returns 'unknown' if the key is not an blob.

// Blob record key <= { 0x65, 0x65 }
uint8_t val[] = {0x65, 0x65}
as_exp_build(expression,
as_exp_cmp_le(as_exp_key_blob(), as_exp_bytes(val, sizeof(val))));
Returns
(blob value) Blob value of the key if the key is a blob.

Definition at line 423 of file as_exp.h.

#define as_exp_key_exist ( )    {.op=_AS_EXP_CODE_KEY_EXIST, .count=1}

Create expression that returns if the primary key is stored in the record meta data as a boolean expression. This would occur when "as_policy_write.key" is AS_POLICY_KEY_SEND on record write.

// Key exists in record meta data
as_exp_build(expression, as_exp_key_exists());
Returns
(boolean value) True if the record has a stored key, false otherwise.

Definition at line 439 of file as_exp.h.

#define as_exp_key_int ( )
Value:
{.op=_AS_EXP_CODE_KEY, .count=2}, \
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns the key as an integer. Returns 'unknown' if the key is not an integer.

// Integer record key >= 10000
as_exp_build(expression,
Returns
(integer value) Integer value of the key if the key is an integer.

Definition at line 390 of file as_exp.h.

#define as_exp_key_str ( )
Value:
{.op=_AS_EXP_CODE_KEY, .count=2}, \
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that returns the key as an string. Returns 'unknown' if the key is not a string.

// String record key == "aaa"
as_exp_build(expression,
Returns
(string value) String value of the key if the key is a string.

Definition at line 406 of file as_exp.h.

#define as_exp_last_update ( )    {.op=_AS_EXP_CODE_LAST_UPDATE, .count=1}

Create expression that returns record last update time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.

// Record last update time >= 2020-01-15
as_exp_build(expression,
Returns
(integer value) When the record was last updated.

Definition at line 724 of file as_exp.h.

#define as_exp_let (   ...)
Value:
{.op=_AS_EXP_CODE_LET}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Define variables and expressions in scope. Requires server version 5.6.0+.

// 5 < a < 10
as_exp_build(expression,
as_exp_lt(as_exp_int(5), as_exp_var("x")),
as_exp_lt(as_exp_var("x"), as_exp_int(10)))));
Parameters
...Variable number of as_exp_def followed by a scoped expression.
Returns
result of scoped expression.

Definition at line 1584 of file as_exp.h.

#define as_exp_list_append (   __ctx,
  __pol,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_APPEND, 1, 2), \
__val, \
{.op=_AS_EXP_CODE_CDT_LIST_CRMOD, .v.list_pol = __pol}, \
__bin

Create expression that appends value to end of list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__valValue expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1652 of file as_exp.h.

#define as_exp_list_append_items (   __ctx,
  __pol,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_APPEND_ITEMS, 1, 2), \
__val, \
{.op=_AS_EXP_CODE_CDT_LIST_CRMOD, .v.list_pol = __pol}, \
__bin

Create expression that appends list items to end of list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__valList items expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1668 of file as_exp.h.

#define as_exp_list_clear (   __ctx,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_CLEAR, 0, 0), \
__bin

Create expression that removes all items in list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1750 of file as_exp.h.

#define as_exp_list_get_by_index (   __ctx,
  __rtype,
  __vtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(__vtype, __rtype, false), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_INDEX, 2), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list item identified by index and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__vtypeValue type (as_exp_type).
__idxIndex integer expression.
__binList bin or list value expression.
Returns
(vtype expression)

Definition at line 2083 of file as_exp.h.

#define as_exp_list_get_by_index_range (   __ctx,
  __rtype,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_INDEX_RANGE, 3), \
as_exp_int(__rtype), \
__idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects "count" list items starting at specified index and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__idxIndex integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2120 of file as_exp.h.

#define as_exp_list_get_by_index_range_to_end (   __ctx,
  __rtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_INDEX_RANGE, 2), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items starting at specified index to the end of list and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__idxIndex integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2101 of file as_exp.h.

#define as_exp_list_get_by_rank (   __ctx,
  __rtype,
  __vtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(__vtype, __rtype, false), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_RANK, 2), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list item identified by rank and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__vtypeValue type (as_exp_type).
__rankRank integer expression.
__binList bin or list value expression.
Returns
(vtype expression)

Definition at line 2139 of file as_exp.h.

#define as_exp_list_get_by_rank_range (   __ctx,
  __rtype,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_RANK_RANGE, 3), \
as_exp_int(__rtype), \
__rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects "count" list items starting at specified rank and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__rankRank integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2176 of file as_exp.h.

#define as_exp_list_get_by_rank_range_to_end (   __ctx,
  __rtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_RANK_RANGE, 2), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items starting at specified rank to the last ranked item and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__rankRank integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2157 of file as_exp.h.

#define as_exp_list_get_by_rel_rank_range (   __ctx,
  __rtype,
  __val,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_VALUE_REL_RANK_RANGE, 4), \
as_exp_int(__rtype), \
__val, __rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items nearest to value and greater by relative rank with a count limit and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__valValues list expression.
__rankRank integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2064 of file as_exp.h.

#define as_exp_list_get_by_rel_rank_range_to_end (   __ctx,
  __rtype,
  __val,
  __rank,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_VALUE_REL_RANK_RANGE, 3), \
as_exp_int(__rtype), \
__val, __rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items nearest to value and greater by relative rank and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__valValues list expression.
__rankRank integer expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2044 of file as_exp.h.

#define as_exp_list_get_by_value (   __ctx,
  __rtype,
  __val,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_ALL_BY_VALUE, 2), \
as_exp_int(__rtype), \
__val, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items identified by value and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__valValue expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 1988 of file as_exp.h.

#define as_exp_list_get_by_value_list (   __ctx,
  __rtype,
  __val,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_VALUE_LIST, 2), \
as_exp_int(__rtype), \
__val, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items identified by values and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__valValues list expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2025 of file as_exp.h.

#define as_exp_list_get_by_value_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_GET_BY_VALUE_INTERVAL, 3), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects list items identified by value range and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_list_return_type).
__beginBegin value expression.
__endEnd value expression.
__binList bin or list value expression.
Returns
(expression)

Definition at line 2007 of file as_exp.h.

#define as_exp_list_increment (   __ctx,
  __pol,
  __idx,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_INCREMENT, 2, 2), \
__idx, __val, \
{.op=_AS_EXP_CODE_CDT_LIST_CRMOD, .v.list_pol = __pol}, \
__bin

Create expression that increments list[index] by value.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__idxIndex integer expression.
__valValue expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1719 of file as_exp.h.

#define as_exp_list_insert (   __ctx,
  __pol,
  __idx,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_INSERT, 2, 1), \
__idx, __val, \
{.op=_AS_EXP_CODE_CDT_LIST_MOD, .v.list_pol = __pol}, \
__bin

Create expression that inserts value to specified index of list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__idxIndex integer expression.
__valValue expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1685 of file as_exp.h.

#define as_exp_list_insert_items (   __ctx,
  __pol,
  __idx,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_INSERT_ITEMS, 2, 1), \
__idx, __val, \
{.op=_AS_EXP_CODE_CDT_LIST_MOD, .v.list_pol = __pol}, \
__bin

Create expression that inserts each input list item starting at specified index of list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__idxIndex integer expression.
__valList items expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1702 of file as_exp.h.

#define as_exp_list_remove_by_index (   __ctx,
  __idx,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX, 2, 0), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list item identified by index.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__idxIndex integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1864 of file as_exp.h.

#define as_exp_list_remove_by_index_range (   __ctx,
  __rtype,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX_RANGE, 3, 0), \
as_exp_int(__rtype), \
__idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes "count" list items starting at specified index.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__idxIndex integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1897 of file as_exp.h.

#define as_exp_list_remove_by_index_range_to_end (   __ctx,
  __rtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_INDEX_RANGE, 2, 0), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items starting at specified index to the end of list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__idxIndex integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1880 of file as_exp.h.

#define as_exp_list_remove_by_rank (   __ctx,
  __rank,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK, 2, 0), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list item identified by rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rankRank integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1912 of file as_exp.h.

#define as_exp_list_remove_by_rank_range (   __ctx,
  __rtype,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK_RANGE, 3, 0), \
as_exp_int(__rtype), \
__rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes "count" list items starting at specified rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__rankRank integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1945 of file as_exp.h.

#define as_exp_list_remove_by_rank_range_to_end (   __ctx,
  __rtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_RANK_RANGE, 2, 0), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items starting at specified rank to the last ranked item.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__rankRank integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1928 of file as_exp.h.

#define as_exp_list_remove_by_rel_rank_range (   __ctx,
  __rtype,
  __val,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), \
as_exp_int(__rtype), \
__val, __rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items nearest to value and greater by relative rank with a count limit.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__valValue expression.
__rankRank integer expression.
__countCount integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1849 of file as_exp.h.

#define as_exp_list_remove_by_rel_rank_range_to_end (   __ctx,
  __rtype,
  __val,
  __rank,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), \
as_exp_int(__rtype), \
__val, __rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items nearest to value and greater by relative rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__valValue expression.
__rankRank integer expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1830 of file as_exp.h.

#define as_exp_list_remove_by_value (   __ctx,
  __rtype,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_ALL_BY_VALUE, 2, 0), \
as_exp_int(__rtype), \
__val, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items identified by value.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__valValue expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1778 of file as_exp.h.

#define as_exp_list_remove_by_value_list (   __ctx,
  __rtype,
  __values,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_LIST, 2, 0), \
as_exp_int(__rtype), \
__values, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items identified by values.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__valuesValues list expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1794 of file as_exp.h.

#define as_exp_list_remove_by_value_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_REMOVE_BY_VALUE_INTERVAL, 3, 0), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes list items identified by value range (begin inclusive, end exclusive). If begin is nil, the range is less than end. If end is infinity, the range is greater than equal to begin.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_LIST_RETURN_NONE or AS_LIST_RETURN_INVERTED.
__beginBegin value expression.
__endEnd value expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1813 of file as_exp.h.

#define as_exp_list_set (   __ctx,
  __pol,
  __idx,
  __val,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, __pol, AS_CDT_OP_LIST_SET, 2, 1), \
__idx, __val, \
{.op=_AS_EXP_CODE_CDT_LIST_MOD, .v.list_pol = __pol}, \
__bin

Create expression that sets item value at specified index in list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional list write policy (as_list_policy).
__idxIndex integer expression.
__valValue expression.
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1736 of file as_exp.h.

#define as_exp_list_size (   __ctx,
  __bin 
)
Value:
_AS_EXP_CDT_LIST_READ(AS_EXP_TYPE_AUTO, AS_LIST_RETURN_COUNT, false), \
_AS_EXP_LIST_START(__ctx, AS_CDT_OP_LIST_SIZE, 0), \
__bin

Create expression that returns list size.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__binList bin or list value expression.
Returns
(integer expression)

Definition at line 1972 of file as_exp.h.

#define as_exp_list_sort (   __ctx,
  __order,
  __bin 
)
Value:
_AS_EXP_LIST_MOD(__ctx, NULL, AS_CDT_OP_LIST_SORT, 1, 0), \
as_exp_int(__order), \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that sorts list.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__orderSort order (as_list_sort_flags).
__binList bin or list value expression.
Returns
(list expression)

Definition at line 1763 of file as_exp.h.

#define as_exp_log (   __num,
  __base 
)    {.op=_AS_EXP_CODE_LOG, .count=3}, __num, __base

Create "log" operator for logarithm of "num" with base "base". All arguments must resolve to floats. Requires server version 5.6.0+.

// log(a, 2) == 4.0
as_exp_build(expression,
as_exp_float(4.0)));
Parameters
__numNumber.
__baseBase value.
Returns
(float value)

Definition at line 1177 of file as_exp.h.

#define as_exp_map_clear (   __ctx,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_CLEAR, 0, 0), \
__bin

Create expression that removes all items in map.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2253 of file as_exp.h.

#define as_exp_map_get_by_index (   __ctx,
  __rtype,
  __vtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_READ(__vtype, __rtype, false), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_INDEX, 2), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map item identified by index and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__vtypeValue type (as_exp_type).
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2756 of file as_exp.h.

#define as_exp_map_get_by_index_range (   __ctx,
  __rtype,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_INDEX_RANGE, 3), \
as_exp_int(__rtype), \
__idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects "count" map items starting at specified index and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__idxIndex integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2793 of file as_exp.h.

#define as_exp_map_get_by_index_range_to_end (   __ctx,
  __rtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_INDEX_RANGE, 2), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items starting at specified index to the end of map and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2774 of file as_exp.h.

#define as_exp_map_get_by_key (   __ctx,
  __rtype,
  __vtype,
  __key,
  __bin 
)
Value:
_AS_EXP_MAP_READ(__vtype, __rtype, false), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_KEY, 2), \
as_exp_int(__rtype), \
__key, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map item identified by key and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__vtypeValue type (as_exp_type).
__keyKey expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2563 of file as_exp.h.

#define as_exp_map_get_by_key_list (   __ctx,
  __rtype,
  __keys,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_KEY_LIST, 2), \
as_exp_int(__rtype), \
__keys, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items identified by keys and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__keysKeys list expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2602 of file as_exp.h.

#define as_exp_map_get_by_key_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_KEY_INTERVAL, 3), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items identified by key range (begin inclusive, end exclusive). If begin is nil, the range is less than end. If end is infinity, the range is greater than equal to begin. Expression returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__beginBegin key expression.
__endEnd key expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2584 of file as_exp.h.

#define as_exp_map_get_by_key_rel_index_range (   __ctx,
  __rtype,
  __key,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_KEY_REL_INDEX_RANGE, 4), \
as_exp_int(__rtype), \
__key, __idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items nearest to key and greater by index with a count limit. Expression returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__keyKey expression.
__idxIndex integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2641 of file as_exp.h.

#define as_exp_map_get_by_key_rel_index_range_to_end (   __ctx,
  __rtype,
  __key,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_KEY_REL_INDEX_RANGE, 3), \
as_exp_int(__rtype), \
__key, __idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items nearest to key and greater by index and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__keyKey expression.
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2621 of file as_exp.h.

#define as_exp_map_get_by_rank (   __ctx,
  __rtype,
  __vtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_READ(__vtype, __rtype, false), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_RANK, 2), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map item identified by rank and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__vtypeValue type (as_exp_type).
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2812 of file as_exp.h.

#define as_exp_map_get_by_rank_range (   __ctx,
  __rtype,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_RANK_RANGE, 3), \
as_exp_int(__rtype), \
__rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects "count" map items starting at specified rank and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__rankRank integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2849 of file as_exp.h.

#define as_exp_map_get_by_rank_range_to_end (   __ctx,
  __rtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_RANK_RANGE, 2), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items starting at specified rank to the last ranked item and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2830 of file as_exp.h.

#define as_exp_map_get_by_value (   __ctx,
  __rtype,
  __val,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_ALL_BY_VALUE, 2), \
as_exp_int(__rtype), \
__val, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items identified by value and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__valValue expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2659 of file as_exp.h.

#define as_exp_map_get_by_value_list (   __ctx,
  __rtype,
  __values,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_VALUE_LIST, 2), \
as_exp_int(__rtype), \
__values, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items identified by values and returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__valuesValues list expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2698 of file as_exp.h.

#define as_exp_map_get_by_value_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_VALUE_INTERVAL, 3), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items identified by value range (begin inclusive, end exclusive). If begin is nil, the range is less than end. If end is infinity, the range is greater than equal to begin. Expression returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__beginBegin value expression.
__endEnd value expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2680 of file as_exp.h.

#define as_exp_map_get_by_value_rel_rank_range (   __ctx,
  __rtype,
  __val,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_VALUE_REL_RANK_RANGE, 4), \
as_exp_int(__rtype), \
__val, __rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items nearest to value and greater by relative rank with a count limit. Expression returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__valValue expression.
__rankRank integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2737 of file as_exp.h.

#define as_exp_map_get_by_value_rel_rank_range_to_end (   __ctx,
  __rtype,
  __val,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_READ(AS_EXP_TYPE_AUTO, __rtype, true), \
_AS_EXP_MAP_START(__ctx, AS_CDT_OP_MAP_GET_BY_VALUE_REL_RANK_RANGE, 3), \
as_exp_int(__rtype), \
__val, __rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that selects map items nearest to value and greater by relative rank. Expression returns selected data specified by rtype.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type (as_map_return_type).
__valValue expression.
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(expression)

Definition at line 2717 of file as_exp.h.

#define as_exp_map_increment (   __ctx,
  __pol,
  __key,
  __val,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, __pol, AS_CDT_OP_MAP_INCREMENT, 2, 1), \
__key, __val, \
{.op=_AS_EXP_CODE_CDT_MAP_MOD, .v.map_pol = __pol}, \
__bin

Create expression that increments values by incr for all items identified by key. Valid only for numbers.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional map write policy (as_map_policy).
__keyKey expression.
__valIncrement value number expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2239 of file as_exp.h.

#define as_exp_map_put (   __ctx,
  __pol,
  __key,
  __val,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, __pol, AS_CDT_OP_MAP_PUT, 2, 2), \
__key, __val, \
{.op=_AS_EXP_CODE_CDT_MAP_CRMOD, .v.map_pol = __pol}, \
__bin

Create expression that writes key/val item to map bin.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional map write policy (as_map_policy).
__keyKey expression.
__valValue expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2205 of file as_exp.h.

#define as_exp_map_put_items (   __ctx,
  __pol,
  __map,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, __pol, AS_CDT_OP_MAP_PUT_ITEMS, 1, 2), \
__map, \
{.op=_AS_EXP_CODE_CDT_MAP_CRMOD, .v.map_pol = __pol}, \
__bin

Create expression that writes each map item to map bin.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__polOptional map write policy (as_map_policy).
__mapSource map expression.
__binTarget map bin or map value expression.
Returns
(map expression)

Definition at line 2221 of file as_exp.h.

#define as_exp_map_remove_by_index (   __ctx,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX, 2, 0), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map item identified by index.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2438 of file as_exp.h.

#define as_exp_map_remove_by_index_range (   __ctx,
  __rtype,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX_RANGE, 3, 0), \
as_exp_int(__rtype), \
__idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes "count" map items starting at specified index.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__idxIndex integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2471 of file as_exp.h.

#define as_exp_map_remove_by_index_range_to_end (   __ctx,
  __rtype,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_INDEX_RANGE, 2, 0), \
as_exp_int(__rtype), \
__idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items starting at specified index to the end of map.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2454 of file as_exp.h.

#define as_exp_map_remove_by_key (   __ctx,
  __key,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY, 2, 0), \
__key, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map item identified by key.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__keyKey expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2266 of file as_exp.h.

#define as_exp_map_remove_by_key_list (   __ctx,
  __rtype,
  __keys,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_LIST, 2, 0), \
as_exp_int(__rtype), \
__keys, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items identified by keys.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__keysList expression of keys to remove.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2282 of file as_exp.h.

#define as_exp_map_remove_by_key_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_INTERVAL, 3, 0), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items identified by key range (begin inclusive, end exclusive). If begin is nil, the range is less than end. If end is infinity, the range is greater than equal to begin.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__beginBegin value expression.
__endEnd value expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2301 of file as_exp.h.

#define as_exp_map_remove_by_key_rel_index_range (   __ctx,
  __rtype,
  __key,
  __idx,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_REL_INDEX_RANGE, 4, 0), \
as_exp_int(__rtype), \
__key, __idx, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items nearest to key and greater by index with a count limit.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__keyKey expression.
__idxIndex integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2336 of file as_exp.h.

#define as_exp_map_remove_by_key_rel_index_range_to_end (   __ctx,
  __rtype,
  __key,
  __idx,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_KEY_REL_INDEX_RANGE, 3, 0), \
as_exp_int(__rtype), \
__key, __idx, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items nearest to key and greater by index.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__keyKey expression.
__idxIndex integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2318 of file as_exp.h.

#define as_exp_map_remove_by_rank (   __ctx,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK, 2, 0), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map item identified by rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2486 of file as_exp.h.

#define as_exp_map_remove_by_rank_range (   __ctx,
  __rtype,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK_RANGE, 3, 0), \
as_exp_int(__rtype), \
__rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes "count" map items starting at specified rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__rankRank integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2519 of file as_exp.h.

#define as_exp_map_remove_by_rank_range_to_end (   __ctx,
  __rtype,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_RANK_RANGE, 2, 0), \
as_exp_int(__rtype), \
__rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items starting at specified rank to the last ranked item.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2502 of file as_exp.h.

#define as_exp_map_remove_by_value (   __ctx,
  __rtype,
  __val,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_ALL_BY_VALUE, 2, 0), \
as_exp_int(__rtype), \
__val, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items identified by value.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__valValue expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2352 of file as_exp.h.

#define as_exp_map_remove_by_value_list (   __ctx,
  __rtype,
  __values,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_LIST, 2, 0), \
as_exp_int(__rtype), \
__values, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items identified by values.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__valuesValues list expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2368 of file as_exp.h.

#define as_exp_map_remove_by_value_range (   __ctx,
  __rtype,
  __begin,
  __end,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_INTERVAL, 3, 0), \
as_exp_int(__rtype), \
__begin, __end, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items identified by value range (begin inclusive, end exclusive). If begin is nil, the range is less than end. If end is infinity, the range is greater than equal to begin.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__beginBegin value expression.
__endEnd value expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2387 of file as_exp.h.

#define as_exp_map_remove_by_value_rel_rank_range (   __ctx,
  __rtype,
  __val,
  __rank,
  __count,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), \
as_exp_int(__rtype), \
__val, __rank, __count, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items nearest to value and greater by relative rank with a count limit.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__valValue expression.
__rankRank integer expression.
__countCount integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2423 of file as_exp.h.

#define as_exp_map_remove_by_value_rel_rank_range_to_end (   __ctx,
  __rtype,
  __val,
  __rank,
  __bin 
)
Value:
_AS_EXP_MAP_MOD(__ctx, NULL, AS_CDT_OP_MAP_REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), \
as_exp_int(__rtype), \
__val, __rank, \
__bin
#define as_exp_int(__val)
Definition: as_exp.h:304

Create expression that removes map items nearest to value and greater by relative rank.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__rtypeReturn type. Valid values are AS_MAP_RETURN_NONE or AS_MAP_RETURN_INVERTED.
__valValue expression.
__rankRank integer expression.
__binMap bin or map value expression.
Returns
(map expression)

Definition at line 2404 of file as_exp.h.

#define as_exp_map_size (   __ctx,
  __bin 
)
Value:

Create expression that returns map size.

Parameters
__ctxOptional context path for nested CDT (as_cdt_ctx).
__binMap bin or map value expression.
Returns
(integer expression)

Definition at line 2546 of file as_exp.h.

#define as_exp_max (   ...)
Value:
{.op=_AS_EXP_CODE_MAX}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// max(a, b, c) > 100
as_exp_build(expression,
as_exp_int(100)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1532 of file as_exp.h.

#define as_exp_memory_size ( )    {.op=_AS_EXP_CODE_MEMORY_SIZE, .count=1}

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 inclusive and 7.0 exclusive. Use as_exp_record_size() for server version 7.0+.

// Record memory size >= 100 KB
as_exp_build(expression,
Returns
(integer value) memory size of the record.

Definition at line 811 of file as_exp.h.

#define as_exp_min (   ...)
Value:
{.op=_AS_EXP_CODE_MIN}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// min(a, b, c) > 0
as_exp_build(expression,
as_exp_int(0)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1512 of file as_exp.h.

#define as_exp_mod (   __numerator,
  __denominator 
)    {.op=_AS_EXP_CODE_MOD, .count=3}, __numerator, __denominator

Create "modulo" (%) operator that determines the remainder of "numerator" divided by "denominator". All arguments must resolve to integers. Requires server version 5.6.0+.

// a % 10 == 0
as_exp_build(expression,
as_exp_int(0)));
Returns
(integer value)

Definition at line 1196 of file as_exp.h.

#define as_exp_mul (   ...)
Value:
{.op=_AS_EXP_CODE_MUL}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// a * b * c < 100
as_exp_build(expression,
as_exp_int(100)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1113 of file as_exp.h.

#define as_exp_nil ( )    as_exp_val(&as_nil)

Create 'nil' value.

Definition at line 359 of file as_exp.h.

#define as_exp_not (   __expr)    {.op=_AS_EXP_CODE_NOT, .count=2}, __expr

Create "not" (!) operator expression.

// ! (a == 0 || a == 10)
as_exp_build(expression,
Parameters
__exprBoolean expression to negate.
Returns
(boolean value)

Definition at line 989 of file as_exp.h.

#define as_exp_or (   ...)
Value:
{.op=_AS_EXP_CODE_OR}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

Create "or" (||) operator that applies to a variable number of expressions.

// a == 0 || b == 0
as_exp_build(expression,
Parameters
...Variable number of boolean expressions.
Returns
(boolean value)

Definition at line 1026 of file as_exp.h.

#define as_exp_pow (   __base,
  __exponent 
)    {.op=_AS_EXP_CODE_POW, .count=3}, __base, __exponent

Create "pow" operator that raises a "base" to the "exponent" power. All arguments must resolve to floats. Requires server version 5.6.0+.

// pow(a, 2.0) == 4.0
as_exp_build(expression,
as_exp_float(4.0)));
Parameters
__baseBase value.
__exponentExponent value.
Returns
(float value)

Definition at line 1156 of file as_exp.h.

#define as_exp_record_size ( )    {.op=_AS_EXP_CODE_RECORD_SIZE, .count=1}

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 as_exp_device_size() and as_exp_memory_size().

// Record size >= 100 KB
as_exp_build(expression,
Returns
(integer value) Uncompressed size of the record.

Definition at line 690 of file as_exp.h.

#define as_exp_set_name ( )    {.op=_AS_EXP_CODE_SET_NAME, .count=1}

Create expression that returns record set name string. This expression usually evaluates quickly because record meta data is cached in memory.

// Record set name == "myset"
as_exp_build(expression,
Returns
(string value) Name of the set this record belongs to.

Definition at line 672 of file as_exp.h.

#define as_exp_since_update ( )    {.op=_AS_EXP_CODE_SINCE_UPDATE, .count=1}

Create expression that returns milliseconds since the record was last updated. This expression usually evaluates quickly because record meta data is cached in memory.

// Record last updated more than 2 hours ago
as_exp_build(expression,
as_exp_int(2 * 60 * 60 * 1000)))
Returns
(integer value) Number of milliseconds since last updated.

Definition at line 741 of file as_exp.h.

#define as_exp_str (   __val)    {.op=_AS_EXP_CODE_VAL_STR, .v.str_val=__val}

Create string value.

Parameters
__valstring value.

Definition at line 328 of file as_exp.h.

#define as_exp_sub (   ...)
Value:
{.op=_AS_EXP_CODE_SUB}, __VA_ARGS__, \
{.op=_AS_EXP_CODE_END_OF_VA_ARGS}

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

// a - b - c > 10
as_exp_build(expression,
as_exp_int(10)));
Parameters
...Variable number of integer or float expressions.
Returns
(integer or float value)

Definition at line 1092 of file as_exp.h.

#define as_exp_to_float (   __num)    {.op=_AS_EXP_CODE_TO_FLOAT, .count=2}, __num

Create expression that converts an integer to a float. Requires server version 5.6.0+.

// float(2) == 2.0
as_exp_build(expression,
as_exp_int(2.0)));
Parameters
__numInteger to convert to a float
Returns
(float-value)

Definition at line 1291 of file as_exp.h.

#define as_exp_to_int (   __num)    {.op=_AS_EXP_CODE_TO_INT, .count=2}, __num

Create expression that converts a float to an integer. Requires server version 5.6.0+.

// int(2.5) == 2
as_exp_build(expression,
as_exp_int(2)));
Parameters
__numInteger to convert to a float
Returns
(float-value)

Definition at line 1272 of file as_exp.h.

#define as_exp_ttl ( )    {.op=_AS_EXP_CODE_TTL, .count=1}

Create expression that returns record expiration time (time to live) in integer seconds.

// Record expires in less than 1 hour
as_exp_build(expression,
Returns
(integer value) Number of seconds till the record will expire, returns -1 if the record never expires.

Definition at line 774 of file as_exp.h.

#define as_exp_uint (   __val)    {.op=_AS_EXP_CODE_VAL_UINT, .v.uint_val=__val}

Create 64 bit unsigned integer value.

Parameters
__valunsigned integer value.

Definition at line 312 of file as_exp.h.

#define as_exp_unknown ( )    {.op=_AS_EXP_CODE_UNKNOWN, .count=1}

Create an 'unknown' value. Used to intentionally fail an expression. The failure can be ignored with AS_EXP_WRITE_EVAL_NO_FAIL or AS_EXP_READ_NO_FAIL. Requires server version 5.6.0+.

// If var("v") (bin("balance") - 100.0) is greater that or equal to 0.0 then
// return var("v") else fail operation.
as_exp_build(expression,
as_exp_bin_float("balance"), as_exp_float(100.0))),
as_exp_ge(as_exp_var("v"), as_exp_float(0)), as_exp_var("v"),
Returns
(unknown value)

Definition at line 288 of file as_exp.h.

#define as_exp_val (   __val)    {.op=_AS_EXP_CODE_AS_VAL, .v.val=(as_val*)(__val)}

Create value from an as_val.

Parameters
__valas_val value.

Definition at line 353 of file as_exp.h.

#define as_exp_var (   __var_name)    {.op=_AS_EXP_CODE_VAR, .count=2}, _AS_EXP_VAL_RAWSTR(__var_name)

Retrieve expression value from a variable. Requires server version 5.6.0+.

// 5 < a < 10
as_exp_build(expression,
as_exp_lt(as_exp_int(5), as_exp_var("x")),
as_exp_lt(as_exp_var("x"), as_exp_int(10)))));
Parameters
__var_nameVariable name.
Returns
value stored in variable.

Definition at line 1626 of file as_exp.h.

#define as_exp_void_time ( )    {.op=_AS_EXP_CODE_VOID_TIME, .count=1}

Create expression that returns record expiration time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.

// Record expires on 2021-01-01
as_exp_build(expression,
Returns
(integer value) Expiration time in nanoseconds since 1970-01-01.

Definition at line 758 of file as_exp.h.

#define as_exp_wildcard ( )    as_exp_val(&as_cmp_wildcard)

Create wildcard value.

Definition at line 371 of file as_exp.h.

Function Documentation

AS_EXTERN void as_exp_destroy ( as_exp exp)

Free expression bytes.

static void as_exp_destroy_base64 ( char *  base64)
inlinestatic

Free base64 string.

Definition at line 258 of file as_exp.h.

References as_exp_destroy_b64().

AS_EXTERN as_exp* as_exp_from_base64 ( const char *  base64)

Decode null-terminated base64 string to expression. Call as_exp_destroy() when done with expression.

static char* as_exp_to_base64 ( as_exp exp)
inlinestatic

Encode expression to null-terminated base64 string. Call as_exp_destroy_base64() when done with base64 string.

Definition at line 232 of file as_exp.h.

References as_exp_compile_b64().