Skip to content

random - Generate a pseudorandom decimal

random will create a pseudorandom number between 0 and 1 exclusively.

NOTE: random is not a cryptographically secure source of randomness.

Syntax

random(): number

Example - Basic usage

To create a random number from 0 to 1 and add it as a field named random_num to a document, one can simple combine random with the create command:

create random_num from random()