RAND (NoSQL query)
APPLIES TO: NoSQL
Returns a randomly generated numeric value from zero to one.
Syntax
RAND()
Return types
Returns a numeric expression.
Examples
The following example returns randomly generated numeric values.
SELECT VALUE {
randomOneToOne: RAND(),
randomeOneToHundred: RAND() * 100
}
[
{
"randomOneToOne": 0.134644033620134,
"randomeOneToHundred": 57.51777137629688
}
]
Remarks
- This function doesn't use the index.
- This function is nondeterministic. Repetitive calls of this function don't return the same results.