Miscellaneous

NameDescriptionExample
now

Returns current timestamp

now() > timestamp("2015-06-24T17:35:50Z")
random

Returns a random number between 0 and 1

1>=random()>=0
size

Returns the length of a string or number of objects in a set

size("Recombee") == 8
item_values

Returns property values of a particular item as a dictionary

item_values("item-42")["description"]
reduce

Reduces a set into a single value using an operator

reduce("+", {1, 2, 3}) == 6

Returns current timestamp.

now()

The following expression results in true:

now() > timestamp("2015-06-24T17:35:50Z")

Returns a random number between 0 and 1.

random()

Returns the length of a string or number of objects in a set.

size(value)
ArgumentType
value

string set

All the following expressions result in true:

size("Recombee") == 8

size("") == 0

size({"abc", 4, {} } ) == 3

// Objects in nested set are not counted
size({ {1,2,3} } ) == 1

Returns property values of a particular item as a dictionary.

item_values(item_id)
ArgumentTypeMeaning
value

string

ID of an item

// Returns value of property "category" for item with ID "item-42"
item_values("item-42")["category"]

Reduces a set into a single value using an operator.

reduce(operator, input_set, initial_value)
ArgumentTypeMeaning
operator

string

One of +, *, &, and, or

input_set

set

Set that will be reduced

initial_value

Same type as members of input_set

Optional. Value used as left operand for the first operation.

All the following expressions result in true:

reduce("+", {2, 3, 4}) == 9

reduce("+", {2, 3, 4}, 1) == 10

reduce("*", {2, 3, 4}) == 24

reduce("and", {true, false, true}) == false

reduce("or", {true, false, true}) == true
© Copyright 2026, Recombee s.r.o
docs.recombee.com