Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13883

Investigate changes in SERVER-30405: add expression to generate a random number

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0, 4.4.2
    • Component/s: manual, Server
    • Labels:
      None
    • Last comment by Customer:
      true
    • Story Points:
      5
    • Sprint:
      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

      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

            Activity

              People

              Assignee:
              dave.cuthbert Dave Cuthbert
              Reporter:
              backlog-server-pm Backlog - Core Eng Program Management Team
              Participants:
              Last commenter:
              Githook User Githook User
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                39 weeks, 3 days ago
                Date of 1st Reply: