Details
-
Task
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
5
-
ServerDocs2020: Oct27 - Nov3, ServerDocs2020: Nov3 - Nov 10, ServerDocs2020: Nov10 - Nov 17, ServerDocs2020: Nov17 - Nov 24, ServerDocs2020: Nov24 - Dec1, ServerDocs2020: Dec1 - Dec8, ServerDocs2020: Dec8 - Dec15, ServerDocs2020: Dec15 - Jan 5, ServerDocs2020: Jan5 - Jan12, ServerDocs2020: Jan12 - Jan19
-
true
Description
Description
Downstream Change Summary
We added a new expression, {$rand:{}} which generates a random number between 0 and 1 (as a float). It takes no arguments.
$rand returns a different value every time it is called. If instead you want to pick a single random number to use for the whole query, you can call $rand in a command-level let variable.
Description of Linked Ticket
For generating a random number during aggregation or something like SERVER-22225 it would be nice to have a way to generate a (pseudo-)random number, either as an expression or an a system variable.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
Attachments
Issue Links
- documents
-
SERVER-30405 add expression to generate a random number
-
- Closed
-