Documentation

Expression
in package

Filter expression, which can be applied to most commands, to control which records are affected by the command.

Table of Contents

Methods

and()  : Expression
Create "and" (&&) operator that applies to a variable number of expressions.
binExists()  : Expression
Create function that returns if bin of specified name exists.
binType()  : Expression
ExpBinType creates a function that returns bin's integer particle type. Valid values are:
blobBin()  : Expression
Create blob bin expression.
blobVal()  : Expression
Creates Blob bin value
boolVal()  : Expression
Creates a Boolean value
cond()  : Expression
-------------------------------------------------- Variables -------------------------------------------------- Conditionally select an expression from a variable number of expression pairs followed by default expression action.
def()  : Expression
Assign variable to an expression that can be accessed later.
deviceSize()  : Expression
Create function that returns record size on disk.
digestModulo()  : Expression
Create function that returns record digest modulo as integer.
eq()  : Expression
Create equal (==) expression.
expLet()  : Expression
Define variables and expressions in scope.
floatBin()  : Expression
Create 64 bit float bin expression.
floatVal()  : Expression
Creates 64 bit float bin value
ge()  : Expression
Create greater than or equal (>=) operation.
geoBin()  : Expression
Create geo bin expression.
geoCompare()  : Expression
Create compare geospatial operation.
geoVal()  : Expression
Create geospatial json string value.
gt()  : Expression
Create greater than (>) operation.
hllBin()  : Expression
Create a HLL bin expression
infinity()  : Expression
Create a Infinity PHPValue
intAnd()  : Expression
Create integer "and" (&) operator that is applied to two or more integers.
intArshift()  : Expression
Create integer "arithmetic right shift" (>>) operator.
intBin()  : Expression
Create 64 bit int bin expression.
intCount()  : Expression
Create expression that returns count of integer bits that are set to 1.
intLscan()  : Expression
Create expression that scans integer bits from left (most significant bit) to right (least significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0.
intLshift()  : Expression
Create integer "left shift" (<<) operator.
intNot()  : Expression
Create integer "not" (~) operator.
intOr()  : Expression
Create integer "or" (|) operator that is applied to two or more integers.
intRscan()  : Expression
Create expression that scans integer bits from right (least significant bit) to left (most significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0.
intRshift()  : Expression
Create integer "logical right shift" (>>>) operator.
intVal()  : Expression
Creates 64 bit integer value
intXor()  : Expression
Create integer "xor" (^) operator that is applied to two or more integers.
isTombstone()  : Expression
Create expression that returns if record has been deleted and is still in tombstone state.
key()  : Expression
Create a record key expression of specified type.
keyExists()  : Expression
Create function that returns if the primary key is stored in the record meta data as a boolean expression. This would occur when `send_key` is true on record write.
lastUpdate()  : Expression
Create function that returns record last update time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
le()  : Expression
Create less than or equals (<=) operation.
listBin()  : Expression
Create list bin expression.
listVal()  : Expression
Create List bin PHPValue Not Supported in pre-alpha release
lt()  : Expression
Create less than (<) operation.
mapBin()  : Expression
Create map bin expression.
mapVal()  : Expression|null
Create Map bin PHPValue Value must be a map
max()  : Expression
Create expression that returns the maximum value in a variable number of expressions.
memorySize()  : Expression
Create expression that returns record size in memory. If server storage-engine is not memory nor data-in-memory, then zero is returned. This expression usually evaluates quickly because record meta data is cached in memory.
min()  : Expression
Create expression that returns the minimum value in a variable number of expressions.
ne()  : Expression
Create not equal (!=) expression
new()  : Expression
nil()  : Expression
Create a Nil PHPValue
not()  : Expression
Create "not" operator expression.
numAbs()  : Expression
Create operator that returns absolute value of a number.
numAdd()  : Expression
Create "add" (+) operator that applies to a variable number of expressions.
numCeil()  : Expression
Create expression that rounds a floating point number up to the closest integer value.
numDiv()  : Expression
Create "divide" (/) operator that applies to a variable number of expressions.
numFloor()  : Expression
Create expression that rounds a floating point number down to the closest integer value.
numLog()  : Expression
Create "log" operator for logarithm of "num" with base "base".
numMod()  : Expression
Create "modulo" (%) operator that determines the remainder of "numerator" divided by "denominator". All arguments must resolve to integers.
numMul()  : Expression
Create "multiply" (*) operator that applies to a variable number of expressions.
numPow()  : Expression
Create "power" operator that raises a "base" to the "exponent" power.
numSub()  : Expression
Create "subtract" (-) operator that applies to a variable number of expressions.
or()  : Expression
Create "or" (||) operator that applies to a variable number of expressions.
regexCompare()  : Expression
Create function like regular expression string operation.
setName()  : Expression
Create function that returns record set name string.
sinceUpdate()  : Expression
Create expression that returns milliseconds since the record was last updated.
stringBin()  : Expression
Create string bin expression.
stringVal()  : Expression
Creates String bin value
toFloat()  : Expression
Create expression that converts a float to an integer.
toInt()  : Expression
Create expression that converts an integer to a float.
ttl()  : Expression
Create function that returns record expiration time (time to live) in integer seconds.
unknown()  : Expression
Create unknown value. Used to intentionally fail an expression.
var()  : Expression
Retrieve expression value from a variable.
voidTime()  : Expression
Create function that returns record expiration time expressed as 64 bit integer nanoseconds since 1970-01-01 epoch.
wildcard()  : Expression
Create a WildCard PHPValue
xor()  : Expression
Create "xor" (^) operator that applies to a variable number of expressions.

Methods

and()

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

public static and(array<string|int, mixed> $exps) : Expression

/// (a > 5 || a == 0) && b < 3

Parameters
$exps : array<string|int, mixed>
Return values
Expression

binType()

ExpBinType creates a function that returns bin's integer particle type. Valid values are:

public static binType(string $name) : Expression

NULL = 0 INTEGER = 1 FLOAT = 2 STRING = 3 BLOB = 4 DIGEST = 6 BOOL = 17 HLL = 18 MAP = 19 LIST = 20 LDT = 21 GEOJSON = 23

Parameters
$name : string
Return values
Expression

cond()

-------------------------------------------------- Variables -------------------------------------------------- Conditionally select an expression from a variable number of expression pairs followed by default expression action.

public static cond(array<string|int, mixed> $exps) : Expression

Requires server version 5.6.0+.

/// Args Format: bool exp1, action exp1, bool exp2, action exp2, ..., action-default
/// Apply operator based on type.
Parameters
$exps : array<string|int, mixed>
Return values
Expression

deviceSize()

Create function that returns record size on disk.

public static deviceSize() : Expression

If server storage-engine is memory, then zero is returned.

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

Return values
Expression

expLet()

Define variables and expressions in scope.

public static expLet(array<string|int, mixed> $exps) : Expression

Requires server version 5.6.0+.

/// 5 < a < 10
Parameters
$exps : array<string|int, mixed>
Return values
Expression

intAnd()

Create integer "and" (&) operator that is applied to two or more integers.

public static intAnd(array<string|int, mixed> $exps) : Expression

All arguments must resolve to integers. Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

intLscan()

Create expression that scans integer bits from left (most significant bit) to right (least significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0.

public static intLscan(Expression $value, Expression $search) : Expression

Requires server version 5.6.0+.

Parameters
$value : Expression
$search : Expression
Return values
Expression

intOr()

Create integer "or" (|) operator that is applied to two or more integers.

public static intOr(array<string|int, mixed> $exps) : Expression

All arguments must resolve to integers. Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

intRscan()

Create expression that scans integer bits from right (least significant bit) to left (most significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If "search" is true, the scan will search for the bit value 1. If "search" is false it will search for bit value 0.

public static intRscan(Expression $value, Expression $search) : Expression

Requires server version 5.6.0+.

Parameters
$value : Expression
$search : Expression
Return values
Expression

intXor()

Create integer "xor" (^) operator that is applied to two or more integers.

public static intXor(array<string|int, mixed> $exps) : Expression

All arguments must resolve to integers. Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

isTombstone()

Create expression that returns if record has been deleted and is still in tombstone state.

public static isTombstone() : Expression

This expression usually evaluates quickly because record meta data is cached in memory.

Return values
Expression

keyExists()

Create function that returns if the primary key is stored in the record meta data as a boolean expression. This would occur when `send_key` is true on record write.

public static keyExists() : Expression
Return values
Expression

max()

Create expression that returns the maximum value in a variable number of expressions.

public static max(array<string|int, mixed> $exps) : Expression

All arguments must be the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

memorySize()

Create expression that returns record size in memory. If server storage-engine is not memory nor data-in-memory, then zero is returned. This expression usually evaluates quickly because record meta data is cached in memory.

public static memorySize() : Expression

Requires server version between 5.3 inclusive and 7.0 exclusive. Use record_size for server version 7.0+.

Return values
Expression

min()

Create expression that returns the minimum value in a variable number of expressions.

public static min(array<string|int, mixed> $exps) : Expression

All arguments must be the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

numAdd()

Create "add" (+) operator that applies to a variable number of expressions.

public static numAdd(array<string|int, mixed> $exps) : Expression

Return sum of all FilterExpressions given. All arguments must resolve to the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

numDiv()

Create "divide" (/) operator that applies to a variable number of expressions.

public static numDiv(array<string|int, mixed> $exps) : Expression

If there is only one FilterExpressions, returns the reciprocal for that FilterExpressions. Otherwise, return the first FilterExpressions divided by the product of the rest. All FilterExpressions must resolve to the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

numMul()

Create "multiply" (*) operator that applies to a variable number of expressions.

public static numMul(array<string|int, mixed> $exps) : Expression

Return the product of all FilterExpressions. If only one FilterExpressions is supplied, return that FilterExpressions. All FilterExpressions must resolve to the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

numSub()

Create "subtract" (-) operator that applies to a variable number of expressions.

public static numSub(array<string|int, mixed> $exps) : Expression

If only one FilterExpressions is provided, return the negation of that argument. Otherwise, return the sum of the 2nd to Nth FilterExpressions subtracted from the 1st FilterExpressions. All FilterExpressions must resolve to the same type (integer or float). Requires server version 5.6.0+.

Parameters
$exps : array<string|int, mixed>
Return values
Expression

sinceUpdate()

Create expression that returns milliseconds since the record was last updated.

public static sinceUpdate() : Expression

This expression usually evaluates quickly because record meta data is cached in memory.

Return values
Expression

unknown()

Create unknown value. Used to intentionally fail an expression.

public static unknown() : Expression

The failure can be ignored with ExpWriteFlags EVAL_NO_FAIL or ExpReadFlags EVAL_NO_FAIL. Requires server version 5.6.0+.

Return values
Expression

        
On this page

Search results