Map expressions
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
Map expressions read and modify map values inside an expression tree. For the data type itself and its Operate API, see Map.
Read expressions (map_size, map_get_by_key, map_get_by_value, the index, rank and range variants) evaluate to whatever result_type selects — a count, an index, a rank, a key, or a value. That makes them projection: they shape what a command returns for each record, in operate, in a batch, and in a query. Wrap one in comparison or logic to get the Boolean a record filter needs.
Modify expressions (map_put, map_put_items, map_increment, map_clear, the map_remove_by_* variants) evaluate to a new map and leave the record untouched. Storing that value takes a write operation expression; see Operations and expressions for how the two APIs differ.
A map operand is a bin, read with bin_map, or any expression that evaluates to a map. Reading stored data can evaluate to unknown; see Unknown results.
For nested collection data and path filters, see Querying collection data types and Path expressions.
The Developer SDK’s AEL text syntax expresses the same map operations as path functions, for example $.profile.name.setTo('Alice').
Composing expressions
An expression evaluates to a value, and that value is what the next expression operates on — see Expressions compose.
Every map operation takes its bin operand that way: not only a named map bin, but the result of any expression evaluating to a map. map_put shows the pattern — its example takes the map_size of the map after the put, so the size counts the new entry while the record keeps the original.
Extraction helpers
map_keys and map_values (Database 8.1.2 and later) are standalone readers: they take a map operand and nothing else, evaluating to a list of the map’s keys or of its values. Alone among the map reads they take neither a context nor a result_type, because there is only one thing each can return.
Use them to turn a map into a list that the rest of the expression tree can work on — testing membership with in_list, for instance, or counting with list_size.
A difference from the CDT Map API
A map modify expression evaluates to the whole modified map. The matching
CDT Map operation returns something
narrower and operation-specific: put returns the new entry count, and the remove-by
operations return what result_type selects.
Each operation’s Example shows the code in nine tabs: Aerospike Expression Language (AEL) text on the Java SDK and Python SDK tabs, and the Exp builder on the other seven. See the AEL reference for AEL grammar.
Modify
map_clear(context, bin)Returns the map with all elements removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using an empty map after map_clear.
String exp = "$.stock:MAP.clear().count() == 0";exp = "$.stock:MAP.clear().count() == 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, map_bin};
let exp = eq(map_exp::size(map_exp::clear(map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.EQ(MapExp.Size(MapExp.Clear(Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq(as.ExpMapSize(as.ExpMapClear(as.ExpMapBin("stock"))), as.ExpIntVal(0))const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.eq(exp.maps.size(exp.maps.clear(exp.binMap('stock'))), exp.int(0))as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_size(NULL, as_exp_map_clear(NULL, as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build(Exp.eq(MapExp.size(MapExp.clear(Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapClear, MapSize
exp = Eq(MapSize(None, MapClear(None, MapBin("stock"))), 0).compile()map_increment(context, policy, key, delta, bin)Returns the map with the value at key increased by delta.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
policy | Map policy | Write flags for the operation. See Write flags. A violated flag fails the expression, unless |
key | any | Map key the operation applies to. |
delta | integer or float | Amount to add to the value stored under |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the value at sku-a after incrementing it by 5.
String exp = "($.stock.'sku-a'.add(5)).'sku-a' == 100";exp = "($.stock.'sku-a'.add(5)).'sku-a' == 100"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{ExpType, eq, int_val, map_bin, string_val};use aerospike::{MapPolicy, MapReturnType};
let exp = eq( map_exp::get_by_key( MapReturnType::Value, ExpType::INT, string_val("sku-a".into()), map_exp::increment( &MapPolicy::default(), string_val("sku-a".into()), int_val(5), map_bin("stock".into()), &[]), &[]), int_val(100));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByKey( MapReturnType.VALUE, Exp.Type.INT, Exp.Val("sku-a"), MapExp.Increment(MapPolicy.Default, Exp.Val("sku-a"), Exp.Val(5), Exp.MapBin("stock"))), Exp.Val(100)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByKey( as.MapReturnType.VALUE, as.ExpTypeINT, as.ExpStringVal("sku-a"), as.ExpMapIncrement( as.DefaultMapPolicy(), as.ExpStringVal("sku-a"), as.ExpIntVal(5), as.ExpMapBin("stock"), ), ), as.ExpIntVal(100),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByKey( exp.maps.increment(exp.binMap('stock'), exp.int(5), exp.str('sku-a'), null), exp.str('sku-a'), exp.type.INT, maps.returnType.VALUE, ), exp.int(100),)as_map_policy mp;as_map_policy_init(&mp);as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_key( NULL, AS_MAP_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_str("sku-a"), as_exp_map_increment(NULL, &mp, as_exp_str("sku-a"), as_exp_int(5), as_exp_bin_map("stock"))), as_exp_int(100)));import com.aerospike.client.cdt.MapPolicy;import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByKey( MapReturnType.VALUE, Exp.Type.INT, Exp.val("sku-a"), MapExp.increment(MapPolicy.Default, Exp.val("sku-a"), Exp.val(5), Exp.mapBin("stock"))), Exp.val(100)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBin, ResultTypefrom aerospike_helpers.expressions.map import MapGetByKey, MapIncrement
exp = Eq( MapGetByKey( None, aerospike.MAP_RETURN_VALUE, ResultType.INTEGER, "sku-a", MapIncrement(None, None, "sku-a", 5, MapBin("stock")), ), 100,).compile()map_put(context, policy, key, value, bin)Returns the map with value stored at key. It does not create a bin that does not exist, unlike the put CDT Map operation, which does.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
policy | Map policy | Write flags for the operation. See Write flags. A violated flag fails the expression, unless |
key | any | Map key the operation applies to. |
value | any | Value to store under |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map after putting {sku-a: 12} into stock.
String exp = "$.stock.'sku-a'.setTo(12).count() > 2";exp = "$.stock.'sku-a'.setTo(12).count() > 2"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapPolicy;
let exp = gt( map_exp::size( map_exp::put( &MapPolicy::default(), string_val("sku-a".into()), int_val(12), map_bin("stock".into()), &[]), &[]), int_val(2));Expression exp = Exp.Build( Exp.GT( MapExp.Size(MapExp.Put(MapPolicy.Default, Exp.Val("sku-a"), Exp.Val(12), Exp.MapBin("stock"))), Exp.Val(2)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapPut( as.DefaultMapPolicy(), as.ExpStringVal("sku-a"), as.ExpIntVal(12), as.ExpMapBin("stock"), ), ), as.ExpIntVal(2),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.maps.size(exp.maps.put(exp.binMap('stock'), exp.int(12), exp.str('sku-a'), null)), exp.int(2),)as_map_policy mp;as_map_policy_init(&mp);as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_put(NULL, &mp, as_exp_str("sku-a"), as_exp_int(12), as_exp_bin_map("stock"))), as_exp_int(2)));import com.aerospike.client.cdt.MapPolicy;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size(MapExp.put(MapPolicy.Default, Exp.val("sku-a"), Exp.val(12), Exp.mapBin("stock"))), Exp.val(2)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapPut, MapSize
exp = GT(MapSize(None, MapPut(None, None, "sku-a", 12, MapBin("stock"))), 2).compile()map_put_items(context, policy, items, bin)Returns the map with every entry of items added. It does not create a bin that does not exist, unlike the put_items CDT Map operation, which does.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
policy | Map policy | Write flags for the operation. See Write flags. A violated flag fails the expression, unless |
items | map | Key/value pairs to write, as a map. A key already present is overwritten; a key that is absent is added. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map after merging additional SKU entries into stock.
String exp = "$.stock.putItems({'sku-b': 2, 'sku-c': 3}).count() > 3";exp = "$.stock.putItems({'sku-b': 2, 'sku-c': 3}).count() > 3"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, map_val};use aerospike::{MapPolicy, Value};use std::collections::HashMap;
let items = HashMap::from([ (Value::from("sku-b"), Value::from(2)), (Value::from("sku-c"), Value::from(3)),]);let exp = gt( map_exp::size( map_exp::put_items( &MapPolicy::default(), map_val(items), map_bin("stock".into()), &[]), &[]), int_val(3));using System.Collections.Generic;
Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.PutItems( MapPolicy.Default, Exp.Val(new Dictionary<string, int> { { "sku-b", 2 }, { "sku-c", 3 } }, MapOrder.UNORDERED), Exp.MapBin("stock"))), Exp.Val(3)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"putMap := map[any]any{"sku-b": 2, "sku-c": 3}exp := as.ExpGreater( as.ExpMapSize(as.ExpMapPutItems(as.DefaultMapPolicy(), as.ExpMapVal(putMap), as.ExpMapBin("stock"))), as.ExpIntVal(3),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.maps.size( exp.maps.putItems(exp.binMap('stock'), exp.map({ 'sku-b': 2, 'sku-c': 3 }), null), ), exp.int(3),)as_map_policy mp;as_map_policy_init(&mp);as_hashmap hm;as_hashmap_init(&hm, 2);as_hashmap_set(&hm, (as_val*)as_string_new_strdup("sku-b"), (as_val*)as_integer_new(2));as_hashmap_set(&hm, (as_val*)as_string_new_strdup("sku-c"), (as_val*)as_integer_new(3));as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_put_items(NULL, &mp, as_exp_val(&hm), as_exp_bin_map("stock"))), as_exp_int(3)));as_hashmap_destroy(&hm);import com.aerospike.client.cdt.MapPolicy;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.putItems( MapPolicy.Default, Exp.val(java.util.Map.of("sku-b", 2, "sku-c", 3)), Exp.mapBin("stock"))), Exp.val(3)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapPutItems, MapSize
exp = GT(MapSize(None, MapPutItems(None, None, {"sku-b": 2, "sku-c": 3}, MapBin("stock"))), 3).compile()map_remove_by_index(context, index, bin)Returns the map with the element at index removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing index 0.
String exp = "$.stock.{0}.remove().count() > 0";exp = "$.stock.{0}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_index( MapReturnType::None, int_val(0), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT(MapExp.Size(MapExp.RemoveByIndex(Exp.Val(0), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize(as.ExpMapRemoveByIndex(as.ExpIntVal(0), as.ExpMapBin("stock"))), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.maps.size(exp.maps.removeByIndex(exp.binMap('stock'), exp.int(0))), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size(NULL, as_exp_map_remove_by_index(NULL, as_exp_int(0), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.size(MapExp.removeByIndex(Exp.val(0), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByIndex, MapSize
exp = GT(MapSize(None, MapRemoveByIndex(None, 0, MapBin("stock"))), 0).compile()map_remove_by_index_range(context, index, count, bin)Returns the map with count elements removed, starting at index.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing one entry at index 0.
String exp = "$.stock.{0:1}.remove().count() > 0";exp = "$.stock.{0:1}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_index_range_count( MapReturnType::None, int_val(0), int_val(1), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByIndexRange(MapReturnType.NONE, Exp.Val(0), Exp.Val(1), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByIndexRangeCount( as.MapReturnType.NONE, as.ExpIntVal(0), as.ExpIntVal(1), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByIndexRange(exp.binMap('stock'), exp.int(1), exp.int(0), null, maps.returnType.NONE), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_index_range( NULL, AS_MAP_RETURN_NONE, as_exp_int(0), as_exp_int(1), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByIndexRange(MapReturnType.NONE, Exp.val(0), Exp.val(1), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByIndexRange, MapSize
exp = GT(MapSize(None, MapRemoveByIndexRange(None, 0, 1, MapBin("stock"))), 0).compile()map_remove_by_index_range_to_end(context, index, bin)Returns the map with every element from index to the end removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing from index 1 to the end.
String exp = "$.stock.{1:}.remove().count() > 0";exp = "$.stock.{1:}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_index_range( MapReturnType::None, int_val(1), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size(MapExp.RemoveByIndexRange(MapReturnType.NONE, Exp.Val(1), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByIndexRange(as.MapReturnType.NONE, as.ExpIntVal(1), as.ExpMapBin("stock")), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByIndexRangeToEnd(exp.binMap('stock'), exp.int(1), null, maps.returnType.NONE), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_index_range_to_end( NULL, AS_MAP_RETURN_NONE, as_exp_int(1), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size(MapExp.removeByIndexRange(MapReturnType.NONE, Exp.val(1), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByIndexRangeToEnd, MapSize
exp = GT(MapSize(None, MapRemoveByIndexRangeToEnd(None, 1, MapBin("stock"))), 0).compile()map_remove_by_key(context, key, bin)Returns the map with the element at key removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
key | any | Map key the operation applies to. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing key sku-a.
String exp = "$.stock.'sku-a'.remove().count() == 2";exp = "$.stock.'sku-a'.remove().count() == 2"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = eq( map_exp::size( map_exp::remove_by_key( MapReturnType::None, string_val("sku-a".into()), map_bin("stock".into()), &[]), &[]), int_val(2));Expression exp = Exp.Build( Exp.EQ(MapExp.Size(MapExp.RemoveByKey(Exp.Val("sku-a"), Exp.MapBin("stock"))), Exp.Val(2)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapSize(as.ExpMapRemoveByKey(as.ExpStringVal("sku-a"), as.ExpMapBin("stock"))), as.ExpIntVal(2),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.eq(exp.maps.size(exp.maps.removeByKey(exp.binMap('stock'), exp.str('sku-a'))), exp.int(2))as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_size(NULL, as_exp_map_remove_by_key(NULL, as_exp_str("sku-a"), as_exp_bin_map("stock"))), as_exp_int(2)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq(MapExp.size(MapExp.removeByKey(Exp.val("sku-a"), Exp.mapBin("stock"))), Exp.val(2)));from aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByKey, MapSize
exp = Eq(MapSize(None, MapRemoveByKey(None, "sku-a", MapBin("stock"))), 2).compile()map_remove_by_key_list(context, keys, bin)Returns the map with every element whose key is in keys removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
keys | list | Keys to match, as a list. Every entry whose key appears in it is removed. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing two keys.
String exp = "$.stock.{@'sku-a', 'sku-b'}.remove().count() == 1";exp = "$.stock.{@'sku-a', 'sku-b'}.remove().count() == 1"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, list_val, map_bin};use aerospike::{MapReturnType, Value};
let exp = eq( map_exp::size( map_exp::remove_by_key_list( MapReturnType::None, list_val(vec![Value::from("sku-a"), Value::from("sku-b")]), map_bin("stock".into()), &[]), &[]), int_val(1));using System.Collections.Generic;
Expression exp = Exp.Build( Exp.EQ( MapExp.Size( MapExp.RemoveByKeyList(MapReturnType.NONE, Exp.Val(new List<string> { "sku-a", "sku-b" }), Exp.MapBin("stock"))), Exp.Val(1)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapSize( as.ExpMapRemoveByKeyList( as.MapReturnType.NONE, as.ExpListVal(as.NewValue("sku-a"), as.NewValue("sku-b")), as.ExpMapBin("stock"), ), ), as.ExpIntVal(1),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.size( exp.maps.removeByKeyList(exp.binMap('stock'), exp.list(['sku-a', 'sku-b']), null, maps.returnType.NONE), ), exp.int(1),)as_arraylist rk;as_arraylist_init(&rk, 2, 2);as_arraylist_append_str(&rk, "sku-a");as_arraylist_append_str(&rk, "sku-b");as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_size( NULL, as_exp_map_remove_by_key_list(NULL, AS_MAP_RETURN_NONE, as_exp_val(&rk), as_exp_bin_map("stock"))), as_exp_int(1)));as_arraylist_destroy(&rk);import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
import java.util.Arrays;
Expression exp = Exp.build( Exp.eq( MapExp.size( MapExp.removeByKeyList( MapReturnType.NONE, Exp.val(Arrays.asList("sku-a", "sku-b")), Exp.mapBin("stock"))), Exp.val(1)));from aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByKeyList, MapSize
exp = Eq(MapSize(None, MapRemoveByKeyList(None, ["sku-a", "sku-b"], MapBin("stock"))), 1).compile()map_remove_by_key_range(context, key_begin, key_end, bin)Returns the map with every element whose key is in the interval key_begin ≤ k < key_end removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
key_begin | any | Lowest key to match, inclusive. |
key_end | any | Upper bound on the key, exclusive. Omit it to match everything from |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing a key interval.
String exp = "$.stock.{@'sku-a':'sku-z'}.remove().count() > 0";exp = "$.stock.{@'sku-a':'sku-z'}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_key_range( MapReturnType::None, Some(string_val("sku-a".into())), Some(string_val("sku-z".into())), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByKeyRange(MapReturnType.NONE, Exp.Val("sku-a"), Exp.Val("sku-z"), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByKeyRange( as.MapReturnType.NONE, as.ExpStringVal("sku-a"), as.ExpStringVal("sku-z"), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByKeyRange( exp.binMap('stock'), exp.str('sku-z'), exp.str('sku-a'), null, maps.returnType.NONE, ), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_key_range( NULL, AS_MAP_RETURN_NONE, as_exp_str("sku-a"), as_exp_str("sku-z"), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByKeyRange( MapReturnType.NONE, Exp.val("sku-a"), Exp.val("sku-z"), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByKeyRange, MapSize
exp = GT(MapSize(None, MapRemoveByKeyRange(None, "sku-a", "sku-z", MapBin("stock"))), 0).compile()map_remove_by_rank(context, rank, bin)Returns the map with the element of rank rank removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing rank 0.
String exp = "$.stock.{#0}.remove().count() > 0";exp = "$.stock.{#0}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_rank( MapReturnType::None, int_val(0), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT(MapExp.Size(MapExp.RemoveByRank(Exp.Val(0), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize(as.ExpMapRemoveByRank(as.ExpIntVal(0), as.ExpMapBin("stock"))), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.maps.size(exp.maps.removeByRank(exp.binMap('stock'), exp.int(0))), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size(NULL, as_exp_map_remove_by_rank(NULL, as_exp_int(0), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.size(MapExp.removeByRank(Exp.val(0), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByRank, MapSize
exp = GT(MapSize(None, MapRemoveByRank(None, 0, MapBin("stock"))), 0).compile()map_remove_by_rank_range(context, rank, count, bin)Returns the map with count elements removed, starting at rank rank.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing two ranks starting at 0.
String exp = "$.stock.{#0:2}.remove().count() > 0";exp = "$.stock.{#0:2}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_rank_range_count( MapReturnType::None, int_val(0), int_val(2), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByRankRange(MapReturnType.NONE, Exp.Val(0), Exp.Val(2), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByRankRangeCount( as.MapReturnType.NONE, as.ExpIntVal(0), as.ExpIntVal(2), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByRankRange(exp.binMap('stock'), exp.int(2), exp.int(0), null, maps.returnType.NONE), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_rank_range( NULL, AS_MAP_RETURN_NONE, as_exp_int(0), as_exp_int(2), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByRankRange(MapReturnType.NONE, Exp.val(0), Exp.val(2), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByRankRange, MapSize
exp = GT(MapSize(None, MapRemoveByRankRange(None, 0, 2, MapBin("stock"))), 0).compile()map_remove_by_rank_range_to_end(context, rank, bin)Returns the map with every element of rank rank or higher removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing from rank 1 to the last rank.
String exp = "$.stock.{#1:}.remove().count() > 0";exp = "$.stock.{#1:}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_rank_range( MapReturnType::None, int_val(1), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size(MapExp.RemoveByRankRange(MapReturnType.NONE, Exp.Val(1), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByRankRange(as.MapReturnType.NONE, as.ExpIntVal(1), as.ExpMapBin("stock")), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByRankRangeToEnd(exp.binMap('stock'), exp.int(1), null, maps.returnType.NONE), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_rank_range_to_end( NULL, AS_MAP_RETURN_NONE, as_exp_int(1), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size(MapExp.removeByRankRange(MapReturnType.NONE, Exp.val(1), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByRankRangeToEnd, MapSize
exp = GT(MapSize(None, MapRemoveByRankRangeToEnd(None, 1, MapBin("stock"))), 0).compile()map_remove_by_rel_index_range(context, key, index, count, bin)Returns the map with count elements removed, starting at the index index places from key.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
key | any | Map key the operation applies to. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after a key-relative index remove with count.
String exp = "$.stock.{0:0~'sku-a'}.remove().count() > 0";exp = "$.stock.{0:0~'sku-a'}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_key_relative_index_range_count( MapReturnType::None, string_val("sku-a".into()), int_val(0), int_val(1), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByKeyRelativeIndexRange( MapReturnType.NONE, Exp.Val("sku-a"), Exp.Val(0), Exp.Val(1), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByKeyRelativeIndexRangeCount( as.MapReturnType.NONE, as.ExpStringVal("sku-a"), as.ExpIntVal(0), as.ExpIntVal(1), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByKeyRelIndexRange( exp.binMap('stock'), exp.int(1), exp.int(0), exp.str('sku-a'), null, maps.returnType.NONE, ), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_key_rel_index_range( NULL, AS_MAP_RETURN_NONE, as_exp_str("sku-a"), as_exp_int(0), as_exp_int(1), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByKeyRelativeIndexRange( MapReturnType.NONE, Exp.val("sku-a"), Exp.val(0), Exp.val(1), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByKeyRelIndexRange, MapSize
exp = GT( MapSize(None, MapRemoveByKeyRelIndexRange(None, "sku-a", 0, 1, MapBin("stock"))), 0,).compile()map_remove_by_rel_index_range_to_end(context, key, index, bin)Returns the map with every element from the index index places from key to the end removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
key | any | Map key the operation applies to. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after a key-relative index remove to end.
String exp = "$.stock.{0:~'sku-a'}.remove().count() > 0";exp = "$.stock.{0:~'sku-a'}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_key_relative_index_range( MapReturnType::None, string_val("sku-a".into()), int_val(0), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByKeyRelativeIndexRange(MapReturnType.NONE, Exp.Val("sku-a"), Exp.Val(0), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByKeyRelativeIndexRange( as.MapReturnType.NONE, as.ExpStringVal("sku-a"), as.ExpIntVal(0), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByKeyRelIndexRangeToEnd( exp.binMap('stock'), exp.int(0), exp.str('sku-a'), null, maps.returnType.NONE, ), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_key_rel_index_range_to_end( NULL, AS_MAP_RETURN_NONE, as_exp_str("sku-a"), as_exp_int(0), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByKeyRelativeIndexRange( MapReturnType.NONE, Exp.val("sku-a"), Exp.val(0), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByKeyRelIndexRangeToEnd, MapSize
exp = GT(MapSize(None, MapRemoveByKeyRelIndexRangeToEnd(None, "sku-a", 0, MapBin("stock"))), 0).compile()map_remove_by_rel_rank_range(context, value, rank, count, bin)Returns the map with count elements removed, starting at the rank rank places from value.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
value | any | Value that |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after a value-relative rank remove with count.
String exp = "$.stock.{#0:1~5}.remove().count() > 0";exp = "$.stock.{#0:1~5}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_value_relative_rank_range_count( MapReturnType::None, int_val(5), int_val(0), int_val(2), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByValueRelativeRankRange( MapReturnType.NONE, Exp.Val(5), Exp.Val(0), Exp.Val(2), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByValueRelativeRankRangeCount( as.MapReturnType.NONE, as.ExpIntVal(5), as.ExpIntVal(0), as.ExpIntVal(2), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByValueRelRankRange( exp.binMap('stock'), exp.int(2), exp.int(0), exp.int(5), null, maps.returnType.NONE, ), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_value_rel_rank_range( NULL, AS_MAP_RETURN_NONE, as_exp_int(5), as_exp_int(0), as_exp_int(2), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByValueRelativeRankRange( MapReturnType.NONE, Exp.val(5), Exp.val(0), Exp.val(2), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByValueRelRankRange, MapSize
exp = GT(MapSize(None, MapRemoveByValueRelRankRange(None, 5, 0, 2, MapBin("stock"))), 0).compile()map_remove_by_rel_rank_range_to_end(context, value, rank, bin)Returns the map with every element from the rank rank places from value to the highest rank removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
value | any | Value that |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after a value-relative rank remove to end.
String exp = "$.stock.{#0:~5}.remove().count() > 0";exp = "$.stock.{#0:~5}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_value_relative_rank_range( MapReturnType::None, int_val(5), int_val(0), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByValueRelativeRankRange(MapReturnType.NONE, Exp.Val(5), Exp.Val(0), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByValueRelativeRankRange( as.MapReturnType.NONE, as.ExpIntVal(5), as.ExpIntVal(0), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByValueRelRankRangeToEnd( exp.binMap('stock'), exp.int(0), exp.int(5), null, maps.returnType.NONE, ), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_value_rel_rank_range_to_end( NULL, AS_MAP_RETURN_NONE, as_exp_int(5), as_exp_int(0), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByValueRelativeRankRange(MapReturnType.NONE, Exp.val(5), Exp.val(0), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByValueRelRankRangeToEnd, MapSize
exp = GT(MapSize(None, MapRemoveByValueRelRankRangeToEnd(None, 5, 0, MapBin("stock"))), 0).compile()map_remove_by_value(context, value, bin)Returns the map with every element whose value equals value removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
value | any | Value to match. Every entry whose value equals it is removed. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing by value 12.
String exp = "$.stock.{=12}.remove().count() > 0";exp = "$.stock.{=12}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_value( MapReturnType::None, int_val(12), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size(MapExp.RemoveByValue(MapReturnType.NONE, Exp.Val(12), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByValue(as.MapReturnType.NONE, as.ExpIntVal(12), as.ExpMapBin("stock")), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size(exp.maps.removeByValue(exp.binMap('stock'), exp.int(12), null, maps.returnType.NONE)), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_value(NULL, AS_MAP_RETURN_NONE, as_exp_int(12), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.size(MapExp.removeByValue(MapReturnType.NONE, Exp.val(12), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByValue, MapSize
exp = GT(MapSize(None, MapRemoveByValue(None, 12, MapBin("stock"))), 0).compile()map_remove_by_value_list(context, values, bin)Returns the map with every element whose value is in values removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
values | list | Values to match, as a list. Every entry whose value equals any of them is removed. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing by values 5 and 12.
String exp = "$.stock.{=5, 12}.remove().count() > 0";exp = "$.stock.{=5, 12}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, list_val, map_bin};use aerospike::{MapReturnType, Value};
let exp = gt( map_exp::size( map_exp::remove_by_value_list( MapReturnType::None, list_val(vec![Value::from(5), Value::from(12)]), map_bin("stock".into()), &[]), &[]), int_val(0));using System.Collections.Generic;
Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByValueList(MapReturnType.NONE, Exp.Val(new List<long> { 5, 12 }), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByValueList( as.MapReturnType.NONE, as.ExpListVal(as.NewValue(5), as.NewValue(12)), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByValueList(exp.binMap('stock'), exp.list([5, 12]), null, maps.returnType.NONE), ), exp.int(0),)as_arraylist rv;as_arraylist_init(&rv, 2, 2);as_arraylist_append_int64(&rv, 5);as_arraylist_append_int64(&rv, 12);as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_value_list(NULL, AS_MAP_RETURN_NONE, as_exp_val(&rv), as_exp_bin_map("stock"))), as_exp_int(0)));as_arraylist_destroy(&rv);import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
import java.util.Arrays;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByValueList(MapReturnType.NONE, Exp.val(Arrays.asList(5, 12)), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByValueList, MapSize
exp = GT(MapSize(None, MapRemoveByValueList(None, [5, 12], MapBin("stock"))), 0).compile()map_remove_by_value_range(context, value_begin, value_end, bin)Returns the map with every element whose value is in the interval value_begin ≤ v < value_end removed.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
value_begin | any | Lowest value to match, inclusive. |
value_end | any | Upper bound on the value, exclusive. Omit it to match everything from |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
map Hypothetical filter using the map size after removing values in [5, 20).
String exp = "$.stock.{=5:20}.remove().count() > 0";exp = "$.stock.{=5:20}.remove().count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::size( map_exp::remove_by_value_range( MapReturnType::None, Some(int_val(5)), Some(int_val(20)), map_bin("stock".into()), &[]), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.Size( MapExp.RemoveByValueRange(MapReturnType.NONE, Exp.Val(5), Exp.Val(20), Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize( as.ExpMapRemoveByValueRange( as.MapReturnType.NONE, as.ExpIntVal(5), as.ExpIntVal(20), as.ExpMapBin("stock"), ), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.size( exp.maps.removeByValueRange(exp.binMap('stock'), exp.int(20), exp.int(5), null, maps.returnType.NONE), ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size( NULL, as_exp_map_remove_by_value_range( NULL, AS_MAP_RETURN_NONE, as_exp_int(5), as_exp_int(20), as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.size( MapExp.removeByValueRange(MapReturnType.NONE, Exp.val(5), Exp.val(20), Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapRemoveByValueRange, MapSize
exp = GT(MapSize(None, MapRemoveByValueRange(None, 5, 20, MapBin("stock"))), 0).compile()Read
map_get_by_index(type, context, result_type, index, bin)Returns the element at index.
| Name | Type | Description |
|---|---|---|
type | integer literal | Data type of the element being read. Expressions are strictly typed, so this getter declares the type it evaluates to; an element of another type fails the expression. |
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the integer value at map index 0 equals 12.
String exp = "$.stock.{0} == 12";exp = "$.stock.{0} == 12"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{ExpType, eq, int_val, map_bin};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_index( MapReturnType::Value, ExpType::INT, int_val(0), map_bin("stock".into()), &[]), int_val(12));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByIndex(MapReturnType.VALUE, Exp.Type.INT, Exp.Val(0), Exp.MapBin("stock")), Exp.Val(12)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByIndex(as.MapReturnType.VALUE, as.ExpTypeINT, as.ExpIntVal(0), as.ExpMapBin("stock")), as.ExpIntVal(12),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByIndex(exp.binMap('stock'), exp.int(0), exp.type.INT, maps.returnType.VALUE), exp.int(12),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_index( NULL, AS_MAP_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_int(0), as_exp_bin_map("stock")), as_exp_int(12)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByIndex(MapReturnType.VALUE, Exp.Type.INT, Exp.val(0), Exp.mapBin("stock")), Exp.val(12)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBin, ResultTypefrom aerospike_helpers.expressions.map import MapGetByIndex
exp = Eq( MapGetByIndex(None, aerospike.MAP_RETURN_VALUE, ResultType.INTEGER, 0, MapBin("stock")), 12,).compile()map_get_by_index_range(context, result_type, index, count, bin)Returns count elements starting at index.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where two entries exist starting at map index 0.
String exp = "$.stock.{0:2}.count() == 2";exp = "$.stock.{0:2}.count() == 2"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, map_bin};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_index_range_count( MapReturnType::Count, int_val(0), int_val(2), map_bin("stock".into()), &[]), int_val(2));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByIndexRange(MapReturnType.COUNT, Exp.Val(0), Exp.Val(2), Exp.MapBin("stock")), Exp.Val(2)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByIndexRangeCount( as.MapReturnType.COUNT, as.ExpIntVal(0), as.ExpIntVal(2), as.ExpMapBin("stock"), ), as.ExpIntVal(2),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByIndexRange(exp.binMap('stock'), exp.int(2), exp.int(0), maps.returnType.COUNT), exp.int(2),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_index_range( NULL, AS_MAP_RETURN_COUNT, as_exp_int(0), as_exp_int(2), as_exp_bin_map("stock")), as_exp_int(2)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByIndexRange(MapReturnType.COUNT, Exp.val(0), Exp.val(2), Exp.mapBin("stock")), Exp.val(2)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapGetByIndexRange
exp = Eq( MapGetByIndexRange(None, aerospike.MAP_RETURN_COUNT, 0, 2, MapBin("stock")), 2,).compile()map_get_by_index_range_to_end(context, result_type, index, bin)Returns every element from index to the end.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count from index 1 to the end is positive.
String exp = "$.stock.{1:}.count() > 0";exp = "$.stock.{1:}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_index_range( MapReturnType::Count, int_val(1), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByIndexRange(MapReturnType.COUNT, Exp.Val(1), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByIndexRange(as.MapReturnType.COUNT, as.ExpIntVal(1), as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByIndexRangeToEnd(exp.binMap('stock'), exp.int(1), maps.returnType.COUNT), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_index_range_to_end( NULL, AS_MAP_RETURN_COUNT, as_exp_int(1), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.getByIndexRange(MapReturnType.COUNT, Exp.val(1), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByIndexRangeToEnd
exp = GT(MapGetByIndexRangeToEnd(None, aerospike.MAP_RETURN_COUNT, 1, MapBin("stock")), 0).compile()map_get_by_key(type, context, result_type, key, bin)Returns the element at key.
| Name | Type | Description |
|---|---|---|
type | integer literal | Data type of the element being read. Expressions are strictly typed, so this getter declares the type it evaluates to; an element of another type fails the expression. |
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
key | any | Map key the operation applies to. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the integer value at key sku-a in stock equals 12.
String exp = "$.stock.'sku-a' == 12";exp = "$.stock.'sku-a' == 12"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{ExpType, eq, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_key( MapReturnType::Value, ExpType::INT, string_val("sku-a".into()), map_bin("stock".into()), &[]), int_val(12));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByKey(MapReturnType.VALUE, Exp.Type.INT, Exp.Val("sku-a"), Exp.MapBin("stock")), Exp.Val(12)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByKey(as.MapReturnType.VALUE, as.ExpTypeINT, as.ExpStringVal("sku-a"), as.ExpMapBin("stock")), as.ExpIntVal(12),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByKey(exp.binMap('stock'), exp.str('sku-a'), exp.type.INT, maps.returnType.VALUE), exp.int(12),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_key( NULL, AS_MAP_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_str("sku-a"), as_exp_bin_map("stock")), as_exp_int(12)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByKey(MapReturnType.VALUE, Exp.Type.INT, Exp.val("sku-a"), Exp.mapBin("stock")), Exp.val(12)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBin, ResultTypefrom aerospike_helpers.expressions.map import MapGetByKey
exp = Eq( MapGetByKey(None, aerospike.MAP_RETURN_VALUE, ResultType.INTEGER, "sku-a", MapBin("stock")), 12,).compile()map_get_by_key_list(context, result_type, keys, bin)Returns every element whose key is in keys.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
keys | list | Keys to match, as a list. Every entry whose key appears in it is selected. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the map has positive COUNT for keys sku-a and sku-b in stock.
String exp = "$.stock.{@'sku-a', 'sku-b'}.count() > 0";exp = "$.stock.{@'sku-a', 'sku-b'}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, list_val, map_bin};use aerospike::{MapReturnType, Value};
let exp = gt( map_exp::get_by_key_list( MapReturnType::Count, list_val(vec![Value::from("sku-a"), Value::from("sku-b")]), map_bin("stock".into()), &[]), int_val(0));using System.Collections.Generic;
Expression exp = Exp.Build( Exp.GT( MapExp.GetByKeyList(MapReturnType.COUNT, Exp.Val(new List<string> { "sku-a", "sku-b" }), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByKeyList( as.MapReturnType.COUNT, as.ExpListVal(as.NewValue("sku-a"), as.NewValue("sku-b")), as.ExpMapBin("stock"), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByKeyList(exp.binMap('stock'), exp.list(['sku-a', 'sku-b']), maps.returnType.COUNT), exp.int(0),)as_arraylist kl;as_arraylist_init(&kl, 2, 2);as_arraylist_append_str(&kl, "sku-a");as_arraylist_append_str(&kl, "sku-b");as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_key_list( NULL, AS_MAP_RETURN_COUNT, as_exp_val(&kl), as_exp_bin_map("stock")), as_exp_int(0)));as_arraylist_destroy(&kl);import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
import java.util.Arrays;
Expression exp = Exp.build( Exp.gt( MapExp.getByKeyList( MapReturnType.COUNT, Exp.val(Arrays.asList("sku-a", "sku-b")), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByKeyList
exp = GT( MapGetByKeyList(None, aerospike.MAP_RETURN_COUNT, ["sku-a", "sku-b"], MapBin("stock")), 0,).compile()map_get_by_key_range(context, result_type, key_begin, key_end, bin)Returns every element whose key is in the interval key_begin ≤ k < key_end.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
key_begin | any | Lowest key to match, inclusive. |
key_end | any | Upper bound on the key, exclusive. Omit it to match everything from |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count of map entries with keys less than sku-z is positive.
String exp = "$.stock.{@:'sku-z'}.count() > 0";exp = "$.stock.{@:'sku-z'}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_key_range( MapReturnType::Count, None, Some(string_val("sku-z".into())), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByKeyRange(MapReturnType.COUNT, null, Exp.Val("sku-z"), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByKeyRange(as.MapReturnType.COUNT, nil, as.ExpStringVal("sku-z"), as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByKeyRange(exp.binMap('stock'), exp.str('sku-z'), exp.nil(), maps.returnType.COUNT), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_key_range( NULL, AS_MAP_RETURN_COUNT, as_exp_nil(), as_exp_str("sku-z"), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.getByKeyRange(MapReturnType.COUNT, Exp.val((String) null), Exp.val("sku-z"), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByKeyRange
exp = GT( MapGetByKeyRange(None, aerospike.MAP_RETURN_COUNT, None, "sku-z", MapBin("stock")), 0,).compile()map_get_by_rank(type, context, result_type, rank, bin)Returns the element of rank rank.
| Name | Type | Description |
|---|---|---|
type | integer literal | Data type of the element being read. Expressions are strictly typed, so this getter declares the type it evaluates to; an element of another type fails the expression. |
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the lowest-ranked value equals 5.
String exp = "$.stock.{#0} == 5";exp = "$.stock.{#0} == 5"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{ExpType, eq, int_val, map_bin};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_rank( MapReturnType::Value, ExpType::INT, int_val(0), map_bin("stock".into()), &[]), int_val(5));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByRank(MapReturnType.VALUE, Exp.Type.INT, Exp.Val(0), Exp.MapBin("stock")), Exp.Val(5)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByRank(as.MapReturnType.VALUE, as.ExpTypeINT, as.ExpIntVal(0), as.ExpMapBin("stock")), as.ExpIntVal(5),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByRank(exp.binMap('stock'), exp.int(0), exp.type.INT, maps.returnType.VALUE), exp.int(5),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_rank( NULL, AS_MAP_RETURN_VALUE, AS_EXP_TYPE_INT, as_exp_int(0), as_exp_bin_map("stock")), as_exp_int(5)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByRank(MapReturnType.VALUE, Exp.Type.INT, Exp.val(0), Exp.mapBin("stock")), Exp.val(5)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBin, ResultTypefrom aerospike_helpers.expressions.map import MapGetByRank
exp = Eq( MapGetByRank(None, aerospike.MAP_RETURN_VALUE, ResultType.INTEGER, 0, MapBin("stock")), 5,).compile()map_get_by_rank_range(context, result_type, rank, count, bin)Returns count elements starting at rank rank.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where exactly two entries are selected starting at rank 0.
String exp = "$.stock.{#0:2}.count() == 2";exp = "$.stock.{#0:2}.count() == 2"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, map_bin};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_rank_range_count( MapReturnType::Count, int_val(0), int_val(2), map_bin("stock".into()), &[]), int_val(2));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByRankRange(MapReturnType.COUNT, Exp.Val(0), Exp.Val(2), Exp.MapBin("stock")), Exp.Val(2)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByRankRangeCount( as.MapReturnType.COUNT, as.ExpIntVal(0), as.ExpIntVal(2), as.ExpMapBin("stock"), ), as.ExpIntVal(2),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByRankRange(exp.binMap('stock'), exp.int(2), exp.int(0), maps.returnType.COUNT), exp.int(2),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_rank_range( NULL, AS_MAP_RETURN_COUNT, as_exp_int(0), as_exp_int(2), as_exp_bin_map("stock")), as_exp_int(2)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByRankRange(MapReturnType.COUNT, Exp.val(0), Exp.val(2), Exp.mapBin("stock")), Exp.val(2)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapGetByRankRange
exp = Eq( MapGetByRankRange(None, aerospike.MAP_RETURN_COUNT, 0, 2, MapBin("stock")), 2,).compile()map_get_by_rank_range_to_end(context, result_type, rank, bin)Returns every element of rank rank or higher.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count from rank 0 to the last rank is positive.
String exp = "$.stock.{#0:}.count() > 0";exp = "$.stock.{#0:}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_rank_range( MapReturnType::Count, int_val(0), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByRankRange(MapReturnType.COUNT, Exp.Val(0), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByRankRange(as.MapReturnType.COUNT, as.ExpIntVal(0), as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByRankRangeToEnd(exp.binMap('stock'), exp.int(0), maps.returnType.COUNT), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_rank_range_to_end( NULL, AS_MAP_RETURN_COUNT, as_exp_int(0), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.getByRankRange(MapReturnType.COUNT, Exp.val(0), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByRankRangeToEnd
exp = GT(MapGetByRankRangeToEnd(None, aerospike.MAP_RETURN_COUNT, 0, MapBin("stock")), 0).compile()map_get_by_rel_index_range(context, result_type, key, index, count, bin)Returns count elements starting at the index index places from key.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
key | any | Map key the operation applies to. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where exactly one entry is selected starting at index 0 relative to key sku-a.
String exp = "$.stock.{0:0~'sku-a'}.count() == 1";exp = "$.stock.{0:0~'sku-a'}.count() == 1"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{eq, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = eq( map_exp::get_by_key_relative_index_range_count( MapReturnType::Count, string_val("sku-a".into()), int_val(0), int_val(1), map_bin("stock".into()), &[]), int_val(1));Expression exp = Exp.Build( Exp.EQ( MapExp.GetByKeyRelativeIndexRange(MapReturnType.COUNT, Exp.Val("sku-a"), Exp.Val(0), Exp.Val(1), Exp.MapBin("stock")), Exp.Val(1)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpEq( as.ExpMapGetByKeyRelativeIndexRangeCount( as.MapReturnType.COUNT, as.ExpStringVal("sku-a"), as.ExpIntVal(0), as.ExpIntVal(1), as.ExpMapBin("stock"), ), as.ExpIntVal(1),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.eq( exp.maps.getByKeyRelIndexRange( exp.binMap('stock'), exp.int(1), exp.int(0), exp.str('sku-a'), maps.returnType.COUNT, ), exp.int(1),)as_exp_build(predexp, as_exp_cmp_eq( as_exp_map_get_by_key_rel_index_range( NULL, AS_MAP_RETURN_COUNT, as_exp_str("sku-a"), as_exp_int(0), as_exp_int(1), as_exp_bin_map("stock")), as_exp_int(1)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.eq( MapExp.getByKeyRelativeIndexRange( MapReturnType.COUNT, Exp.val("sku-a"), Exp.val(0), Exp.val(1), Exp.mapBin("stock")), Exp.val(1)));import aerospikefrom aerospike_helpers.expressions import Eq, MapBinfrom aerospike_helpers.expressions.map import MapGetByKeyRelIndexRange
exp = Eq( MapGetByKeyRelIndexRange(None, aerospike.MAP_RETURN_COUNT, "sku-a", 0, 1, MapBin("stock")), 1,).compile()map_get_by_rel_index_range_to_end(context, result_type, key, index, bin)Returns every element from the index index places from key to the end.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
key | any | Map key the operation applies to. |
index | integer | Zero-based position in the collection, 0 being the first element. A negative index counts back from the end. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the COUNT of entries from index 0 relative to key sku-a is positive.
String exp = "$.stock.{0:~'sku-a'}.count() > 0";exp = "$.stock.{0:~'sku-a'}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin, string_val};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_key_relative_index_range( MapReturnType::Count, string_val("sku-a".into()), int_val(0), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByKeyRelativeIndexRange(MapReturnType.COUNT, Exp.Val("sku-a"), Exp.Val(0), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByKeyRelativeIndexRange( as.MapReturnType.COUNT, as.ExpStringVal("sku-a"), as.ExpIntVal(0), as.ExpMapBin("stock"), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByKeyRelIndexRangeToEnd( exp.binMap('stock'), exp.int(0), exp.str('sku-a'), maps.returnType.COUNT, ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_key_rel_index_range_to_end( NULL, AS_MAP_RETURN_COUNT, as_exp_str("sku-a"), as_exp_int(0), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.getByKeyRelativeIndexRange( MapReturnType.COUNT, Exp.val("sku-a"), Exp.val(0), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByKeyRelIndexRangeToEnd
exp = GT( MapGetByKeyRelIndexRangeToEnd(None, aerospike.MAP_RETURN_COUNT, "sku-a", 0, MapBin("stock")), 0,).compile()map_get_by_rel_rank_range(context, result_type, value, rank, count, bin)Returns count elements starting at the rank rank places from value.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
value | any | Value that |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
count | integer | Number of elements in the range. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where bounded relative-rank selection from value 5 has positive COUNT.
String exp = "$.stock.{#0:1~5}.count() > 0";exp = "$.stock.{#0:1~5}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_value_relative_rank_range_count( MapReturnType::Count, int_val(5), int_val(0), int_val(2), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByValueRelativeRankRange( MapReturnType.COUNT, Exp.Val(5), Exp.Val(0), Exp.Val(2), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByValueRelativeRankRangeCount( as.MapReturnType.COUNT, as.ExpIntVal(5), as.ExpIntVal(0), as.ExpIntVal(2), as.ExpMapBin("stock"), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByValueRelRankRange( exp.binMap('stock'), exp.int(2), exp.int(0), exp.int(5), maps.returnType.COUNT, ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_value_rel_rank_range( NULL, AS_MAP_RETURN_COUNT, as_exp_int(5), as_exp_int(0), as_exp_int(2), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.getByValueRelativeRankRange( MapReturnType.COUNT, Exp.val(5), Exp.val(0), Exp.val(2), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByValueRelRankRange
exp = GT( MapGetByValueRelRankRange(None, aerospike.MAP_RETURN_COUNT, 5, 0, 2, MapBin("stock")), 0,).compile()map_get_by_rel_rank_range_to_end(context, result_type, value, rank, bin)Returns every element from the rank rank places from value to the highest rank.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
value | any | Value that |
rank | integer | Rank of the element in value order, 0 being the smallest. A negative rank counts back from the largest. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where relative rank selection from value 5 has positive COUNT.
String exp = "$.stock.{#0:~5}.count() > 0";exp = "$.stock.{#0:~5}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_value_relative_rank_range( MapReturnType::Count, int_val(5), int_val(0), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByValueRelativeRankRange(MapReturnType.COUNT, Exp.Val(5), Exp.Val(0), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByValueRelativeRankRange( as.MapReturnType.COUNT, as.ExpIntVal(5), as.ExpIntVal(0), as.ExpMapBin("stock"), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByValueRelRankRangeToEnd( exp.binMap('stock'), exp.int(0), exp.int(5), maps.returnType.COUNT, ), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_value_rel_rank_range_to_end( NULL, AS_MAP_RETURN_COUNT, as_exp_int(5), as_exp_int(0), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.getByValueRelativeRankRange( MapReturnType.COUNT, Exp.val(5), Exp.val(0), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByValueRelRankRangeToEnd
exp = GT( MapGetByValueRelRankRangeToEnd(None, aerospike.MAP_RETURN_COUNT, 5, 0, MapBin("stock")), 0,).compile()map_get_by_value(context, result_type, value, bin)Returns every element whose value equals value.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
value | any | Value to match. Every entry whose value equals it is selected. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count of map entries with value 12 is positive.
String exp = "$.stock.{=12,}.count() > 0";exp = "$.stock.{=12,}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_value( MapReturnType::Count, int_val(12), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT(MapExp.GetByValue(MapReturnType.COUNT, Exp.Val(12), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByValue(as.MapReturnType.COUNT, as.ExpIntVal(12), as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByValue(exp.binMap('stock'), exp.int(12), maps.returnType.COUNT), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_value(NULL, AS_MAP_RETURN_COUNT, as_exp_int(12), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.getByValue(MapReturnType.COUNT, Exp.val(12), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByValue
exp = GT(MapGetByValue(None, aerospike.MAP_RETURN_COUNT, 12, MapBin("stock")), 0).compile()map_get_by_value_list(context, result_type, values, bin)Returns every element whose value is in values.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
values | list | Values to match, as a list. Every entry whose value equals any of them is selected. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count of entries with values 5 and 12 is positive.
String exp = "$.stock.{=5, 12}.count() > 0";exp = "$.stock.{=5, 12}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, list_val, map_bin};use aerospike::{MapReturnType, Value};
let exp = gt( map_exp::get_by_value_list( MapReturnType::Count, list_val(vec![Value::from(5), Value::from(12)]), map_bin("stock".into()), &[]), int_val(0));using System.Collections.Generic;
Expression exp = Exp.Build( Exp.GT( MapExp.GetByValueList(MapReturnType.COUNT, Exp.Val(new List<long> { 5, 12 }), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByValueList( as.MapReturnType.COUNT, as.ExpListVal(as.NewValue(5), as.NewValue(12)), as.ExpMapBin("stock"), ), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByValueList(exp.binMap('stock'), exp.list([5, 12]), maps.returnType.COUNT), exp.int(0),)as_arraylist vl;as_arraylist_init(&vl, 2, 2);as_arraylist_append_int64(&vl, 5);as_arraylist_append_int64(&vl, 12);as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_value_list( NULL, AS_MAP_RETURN_COUNT, as_exp_val(&vl), as_exp_bin_map("stock")), as_exp_int(0)));as_arraylist_destroy(&vl);import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
import java.util.Arrays;
Expression exp = Exp.build( Exp.gt( MapExp.getByValueList(MapReturnType.COUNT, Exp.val(Arrays.asList(5, 12)), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByValueList
exp = GT( MapGetByValueList(None, aerospike.MAP_RETURN_COUNT, [5, 12], MapBin("stock")), 0,).compile()map_get_by_value_range(context, result_type, value_begin, value_end, bin)Returns every element whose value is in the interval value_begin ≤ v < value_end.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
result_type | integer literal | Which form the result takes, such as count, index, rank, or value. See Return types. |
value_begin | integer | Lowest value to match, inclusive. |
value_end | integer | Upper bound on the value, exclusive. Omit it to match everything from |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
any Filter where the count of values in [5, 50) in stock is positive.
String exp = "$.stock.{=5:50}.count() > 0";exp = "$.stock.{=5:50}.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};use aerospike::MapReturnType;
let exp = gt( map_exp::get_by_value_range( MapReturnType::Count, Some(int_val(5)), Some(int_val(50)), map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( MapExp.GetByValueRange(MapReturnType.COUNT, Exp.Val(5), Exp.Val(50), Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapGetByValueRange(as.MapReturnType.COUNT, as.ExpIntVal(5), as.ExpIntVal(50), as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.expconst maps = Aerospike.maps
const filterExp = exp.gt( exp.maps.getByValueRange(exp.binMap('stock'), exp.int(50), exp.int(5), maps.returnType.COUNT), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_get_by_value_range( NULL, AS_MAP_RETURN_COUNT, as_exp_int(5), as_exp_int(50), as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.cdt.MapReturnType;import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt( MapExp.getByValueRange(MapReturnType.COUNT, Exp.val(5), Exp.val(50), Exp.mapBin("stock")), Exp.val(0)));import aerospikefrom aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetByValueRange
exp = GT(MapGetByValueRange(None, aerospike.MAP_RETURN_COUNT, 5, 50, MapBin("stock")), 0).compile()map_keys(bin)Returns the map’s keys as a list. Unlike the other map reads it takes neither a context nor a result_type, because there is only one thing it can return.
| Name | Type | Description |
|---|---|---|
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
list Get the keys of map bin stock as a list, then check its list_size is greater than 0.
String exp = "$.stock:MAP.*.getKeys().count() > 0";exp = "$.stock:MAP.*.getKeys().count() > 0"use aerospike::expressions::lists as list_exp;use aerospike::expressions::{gt, int_val, map_bin, map_keys};
let exp = gt(list_exp::size(map_keys(map_bin("stock".into())), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( ListExp.Size(Exp.MapKeysIn(Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpListSize(as.ExpMapKeys(as.ExpMapBin("stock"))), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.lists.size(exp.mapKeys(exp.binMap('stock'))), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_list_size(NULL, as_exp_map_keys_in(as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.ListExp;
Expression exp = Exp.build( Exp.gt( ListExp.size(Exp.mapKeysIn(Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetKeysfrom aerospike_helpers.expressions.list import ListSize
exp = GT(ListSize(None, MapGetKeys(MapBin("stock"))), 0).compile()map_size(context, bin)Returns the number of elements in the map.
| Name | Type | Description |
|---|---|---|
context | Context instance | Optional context path selecting a List or Map nested inside the operand. Omit it to operate on the top level. |
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
integer Filter records whose map bin stock is non-empty (same pattern as bin_map with size).
String exp = "$.stock:MAP.count() > 0";exp = "$.stock:MAP.count() > 0"use aerospike::expressions::maps as map_exp;use aerospike::expressions::{gt, int_val, map_bin};
let exp = gt(map_exp::size(map_bin("stock".into()), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT(MapExp.Size(Exp.MapBin("stock")), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpMapSize(as.ExpMapBin("stock")), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.maps.size(exp.binMap('stock')), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_map_size(NULL, as_exp_bin_map("stock")), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.MapExp;
Expression exp = Exp.build( Exp.gt(MapExp.size(Exp.mapBin("stock")), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapSize
exp = GT(MapSize(None, MapBin("stock")), 0).compile()map_values(bin)Returns the map’s values as a list. Unlike the other map reads it takes neither a context nor a result_type, because there is only one thing it can return.
| Name | Type | Description |
|---|---|---|
bin | map | Map bin to operate on, or any expression that evaluates to a map. |
list Get the values of map bin stock as a list, then check its list_size is greater than 0.
String exp = "$.stock:MAP.*.count() > 0";exp = "$.stock:MAP.*.count() > 0"use aerospike::expressions::lists as list_exp;use aerospike::expressions::{gt, int_val, map_bin, map_values};
let exp = gt(list_exp::size(map_values(map_bin("stock".into())), &[]), int_val(0));Expression exp = Exp.Build( Exp.GT( ListExp.Size(Exp.MapValuesIn(Exp.MapBin("stock"))), Exp.Val(0)));// Requires: import as "github.com/aerospike/aerospike-client-go/v8"exp := as.ExpGreater( as.ExpListSize(as.ExpMapValues(as.ExpMapBin("stock"))), as.ExpIntVal(0),)const Aerospike = require('aerospike')const exp = Aerospike.exp
const filterExp = exp.gt( exp.lists.size(exp.mapValues(exp.binMap('stock'))), exp.int(0),)as_exp_build(predexp, as_exp_cmp_gt( as_exp_list_size(NULL, as_exp_map_values_in(as_exp_bin_map("stock"))), as_exp_int(0)));import com.aerospike.client.exp.Expression;import com.aerospike.client.exp.Exp;import com.aerospike.client.exp.ListExp;
Expression exp = Exp.build( Exp.gt( ListExp.size(Exp.mapValuesIn(Exp.mapBin("stock"))), Exp.val(0)));from aerospike_helpers.expressions import GT, MapBinfrom aerospike_helpers.expressions.map import MapGetValuesfrom aerospike_helpers.expressions.list import ListSize
exp = GT(ListSize(None, MapGetValues(MapBin("stock"))), 0).compile()