Skip to content

random

Description

Returns a pseudorandom decimal between 0 (inclusive) and 1 (exclusive).

Note

Not cryptographically secure.

Syntax

random(): number

Example

Description

Use case: Add a random decimal field

Generate a pseudorandom number between 0 and 1 and attach it to each document.

{
    "event": "login_attempt"
}

Example query

create random_num from random()

Example output

{
    "event": "login_attempt",
    "random_num": 0.732145691
}