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.
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for