public final class MapExp extends Object
Exp
.
The bin expression argument in these methods can be a reference to a bin or the result of another expression. Expressions that modify bin values are only used for temporary expression evaluation and are not permanently applied to the bin.
Map modify expressions return the bin's value. This value will be a map except when the map is nested within a list. In that case, a list is returned for the map modify expression.
All maps maintain an index and a rank. The index is the item offset from the start of the map, for both unordered and ordered maps. The rank is the sorted index of the value component. Map supports negative indexing for index and rank.
Index examples:
Rank examples:
Nested expressions are supported by optional CTX context arguments. Example:
Constructor and Description |
---|
MapExp() |
Modifier and Type | Method and Description |
---|---|
static Exp |
clear(Exp bin,
CTX... ctx)
Create expression that removes all items in map.
|
static Exp |
getByIndex(int returnType,
Exp.Type valueType,
Exp index,
Exp bin,
CTX... ctx)
Create expression that selects map item identified by index and returns selected data specified by
returnType (See
MapReturnType ). |
static Exp |
getByIndexRange(int returnType,
Exp index,
Exp bin,
CTX... ctx)
Create expression that selects map items starting at specified index to the end of map and returns selected
data specified by returnType (See
MapReturnType ). |
static Exp |
getByIndexRange(int returnType,
Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects "count" map items starting at specified index and returns selected data
specified by returnType (See
MapReturnType ). |
static Exp |
getByKey(int returnType,
Exp.Type valueType,
Exp key,
Exp bin,
CTX... ctx)
Create expression that selects map item identified by key and returns selected data
specified by returnType.
|
static Exp |
getByKeyList(int returnType,
Exp keys,
Exp bin,
CTX... ctx)
Create expression that selects map items identified by keys and returns selected data specified by
returnType (See
MapReturnType ). |
static Exp |
getByKeyRange(int returnType,
Exp keyBegin,
Exp keyEnd,
Exp bin,
CTX... ctx)
Create expression that selects map items identified by key range (keyBegin inclusive, keyEnd exclusive).
|
static Exp |
getByKeyRelativeIndexRange(int returnType,
Exp key,
Exp index,
Exp bin,
CTX... ctx)
Create expression that selects map items nearest to key and greater by index.
|
static Exp |
getByKeyRelativeIndexRange(int returnType,
Exp key,
Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects map items nearest to key and greater by index with a count limit.
|
static Exp |
getByRank(int returnType,
Exp.Type valueType,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects map item identified by rank and returns selected data specified by
returnType (See
MapReturnType ). |
static Exp |
getByRankRange(int returnType,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects map items starting at specified rank to the last ranked item and
returns selected data specified by returnType (See
MapReturnType ). |
static Exp |
getByRankRange(int returnType,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects "count" map items starting at specified rank and returns selected
data specified by returnType (See
MapReturnType ). |
static Exp |
getByValue(int returnType,
Exp value,
Exp bin,
CTX... ctx)
Create expression that selects map items identified by value and returns selected data
specified by returnType.
|
static Exp |
getByValueList(int returnType,
Exp values,
Exp bin,
CTX... ctx)
Create expression that selects map items identified by values and returns selected data specified by
returnType (See
MapReturnType ). |
static Exp |
getByValueRange(int returnType,
Exp valueBegin,
Exp valueEnd,
Exp bin,
CTX... ctx)
Create expression that selects map items identified by value range (valueBegin inclusive, valueEnd exclusive)
If valueBegin is null, the range is less than valueEnd.
|
static Exp |
getByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects map items nearest to value and greater by relative rank.
|
static Exp |
getByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects map items nearest to value and greater by relative rank with a count limit.
|
static Exp |
increment(MapPolicy policy,
Exp key,
Exp incr,
Exp bin,
CTX... ctx)
Create expression that increments values by incr for all items identified by key.
|
static Exp |
put(MapPolicy policy,
Exp key,
Exp value,
Exp bin,
CTX... ctx)
Create expression that writes key/value item to map bin.
|
static Exp |
putItems(MapPolicy policy,
Exp map,
Exp bin,
CTX... ctx)
Create expression that writes each map item to map bin.
|
static Exp |
removeByIndex(Exp index,
Exp bin,
CTX... ctx)
Create expression that removes map item identified by index.
|
static Exp |
removeByIndexRange(Exp index,
Exp bin,
CTX... ctx)
Create expression that removes map items starting at specified index to the end of map.
|
static Exp |
removeByIndexRange(Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes "count" map items starting at specified index.
|
static Exp |
removeByKey(Exp key,
Exp bin,
CTX... ctx)
Create expression that removes map item identified by key.
|
static Exp |
removeByKeyList(Exp keys,
Exp bin,
CTX... ctx)
Create expression that removes map items identified by keys.
|
static Exp |
removeByKeyRange(Exp keyBegin,
Exp keyEnd,
Exp bin,
CTX... ctx)
Create expression that removes map items identified by key range (keyBegin inclusive, keyEnd exclusive).
|
static Exp |
removeByKeyRelativeIndexRange(Exp key,
Exp index,
Exp bin,
CTX... ctx)
Create expression that removes map items nearest to key and greater by index.
|
static Exp |
removeByKeyRelativeIndexRange(Exp key,
Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes map items nearest to key and greater by index with a count limit.
|
static Exp |
removeByRank(Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes map item identified by rank.
|
static Exp |
removeByRankRange(Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes map items starting at specified rank to the last ranked item.
|
static Exp |
removeByRankRange(Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes "count" map items starting at specified rank.
|
static Exp |
removeByValue(Exp value,
Exp bin,
CTX... ctx)
Create expression that removes map items identified by value.
|
static Exp |
removeByValueList(Exp values,
Exp bin,
CTX... ctx)
Create expression that removes map items identified by values.
|
static Exp |
removeByValueRange(Exp valueBegin,
Exp valueEnd,
Exp bin,
CTX... ctx)
Create expression that removes map items identified by value range (valueBegin inclusive, valueEnd exclusive).
|
static Exp |
removeByValueRelativeRankRange(Exp value,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes map items nearest to value and greater by relative rank.
|
static Exp |
removeByValueRelativeRankRange(Exp value,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes map items nearest to value and greater by relative rank with a count limit.
|
static Exp |
size(Exp bin,
CTX... ctx)
Create expression that returns list size.
|
public static Exp put(MapPolicy policy, Exp key, Exp value, Exp bin, CTX... ctx)
public static Exp putItems(MapPolicy policy, Exp map, Exp bin, CTX... ctx)
public static Exp increment(MapPolicy policy, Exp key, Exp incr, Exp bin, CTX... ctx)
public static Exp removeByKey(Exp key, Exp bin, CTX... ctx)
public static Exp removeByKeyList(Exp keys, Exp bin, CTX... ctx)
public static Exp removeByKeyRange(Exp keyBegin, Exp keyEnd, Exp bin, CTX... ctx)
public static Exp removeByKeyRelativeIndexRange(Exp key, Exp index, Exp bin, CTX... ctx)
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
public static Exp removeByKeyRelativeIndexRange(Exp key, Exp index, Exp count, Exp bin, CTX... ctx)
Examples for map [{0=17},{4=2},{5=15},{9=10}]:
public static Exp removeByValue(Exp value, Exp bin, CTX... ctx)
public static Exp removeByValueList(Exp values, Exp bin, CTX... ctx)
public static Exp removeByValueRange(Exp valueBegin, Exp valueEnd, Exp bin, CTX... ctx)
public static Exp removeByValueRelativeRankRange(Exp value, Exp rank, Exp bin, CTX... ctx)
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
public static Exp removeByValueRelativeRankRange(Exp value, Exp rank, Exp count, Exp bin, CTX... ctx)
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
public static Exp removeByIndex(Exp index, Exp bin, CTX... ctx)
public static Exp removeByIndexRange(Exp index, Exp bin, CTX... ctx)
public static Exp removeByIndexRange(Exp index, Exp count, Exp bin, CTX... ctx)
public static Exp removeByRank(Exp rank, Exp bin, CTX... ctx)
public static Exp removeByRankRange(Exp rank, Exp bin, CTX... ctx)
public static Exp removeByRankRange(Exp rank, Exp count, Exp bin, CTX... ctx)
public static Exp size(Exp bin, CTX... ctx)
// Map bin "a" size > 7
Exp.gt(MapExp.size(Exp.mapBin("a")), Exp.val(7))
public static Exp getByKey(int returnType, Exp.Type valueType, Exp key, Exp bin, CTX... ctx)
// Map bin "a" contains key "B"
Exp.gt(
MapExp.getByKey(MapReturnType.COUNT, Exp.Type.INT, Exp.val("B"), Exp.mapBin("a")),
Exp.val(0));
returnType
- metadata attributes to return. See MapReturnType
valueType
- expected type of return valuekey
- map key expressionbin
- bin or map value expressionctx
- optional context path for nested CDTpublic static Exp getByKeyRange(int returnType, Exp keyBegin, Exp keyEnd, Exp bin, CTX... ctx)
Expression returns selected data specified by returnType (See MapReturnType
).
public static Exp getByKeyList(int returnType, Exp keys, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByKeyRelativeIndexRange(int returnType, Exp key, Exp index, Exp bin, CTX... ctx)
MapReturnType
).
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
public static Exp getByKeyRelativeIndexRange(int returnType, Exp key, Exp index, Exp count, Exp bin, CTX... ctx)
MapReturnType
).
Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:
public static Exp getByValue(int returnType, Exp value, Exp bin, CTX... ctx)
// Map bin "a" contains value "BBB"
Exp.gt(
MapExp.getByValue(MapReturnType.COUNT, Exp.val("BBB"), Exp.mapBin("a")),
Exp.val(0))
returnType
- metadata attributes to return. See MapReturnType
value
- value expressionbin
- bin or map value expressionctx
- optional context path for nested CDTpublic static Exp getByValueRange(int returnType, Exp valueBegin, Exp valueEnd, Exp bin, CTX... ctx)
Expression returns selected data specified by returnType (See MapReturnType
).
public static Exp getByValueList(int returnType, Exp values, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp bin, CTX... ctx)
MapReturnType
).
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
public static Exp getByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp count, Exp bin, CTX... ctx)
MapReturnType
).
Examples for map [{4=2},{9=10},{5=15},{0=17}]:
public static Exp getByIndex(int returnType, Exp.Type valueType, Exp index, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByIndexRange(int returnType, Exp index, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByIndexRange(int returnType, Exp index, Exp count, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByRank(int returnType, Exp.Type valueType, Exp rank, Exp bin, CTX... ctx)
MapReturnType
).public static Exp getByRankRange(int returnType, Exp rank, Exp bin, CTX... ctx)
MapReturnType
).Copyright © 2012–2023 Aerospike, Inc. All rights reserved.