[DOCS-13883] Investigate changes in SERVER-30405: add expression to generate a random number Created: 18/Sep/20  Updated: 13/Nov/23  Resolved: 12/Jan/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.7.0, 4.4.2, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Dave Cuthbert (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-30405 add expression to generate a random n... Closed
Participants:
Days since reply: 3 years, 3 weeks, 6 days ago
Epic Link: DOCSP-9747
Story Points: 5

 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.)



 Comments   
Comment by Githook User [ 14/Jan/21 ]

Author:

{'name': 'Dave Cuthbert', 'email': 'dave.cuthbert@mongodb.com', 'username': 'davemungo'}

Message: DOCS-13883 Update left nav index
Branch: master
https://github.com/mongodb/docs/commit/e18406475a0163148c1cc721269572d80b6af40d

Comment by Githook User [ 12/Jan/21 ]

Author:

{'name': 'Dave Cuthbert', 'email': 'dave.cuthbert@mongodb.com', 'username': 'davemungo'}

Message: DOCS-13883 add random number generator
Branch: master
https://github.com/mongodb/docs/commit/b335602fc7ea4e645d381100dfe4368ac1eee9d9

Comment by Githook User [ 11/Jan/21 ]

Author:

{'name': 'Dave Cuthbert', 'email': 'dave.cuthbert@mongodb.com', 'username': 'davemungo'}

Message: DOCS-13883 add random number generator
Branch: v5.0
https://github.com/mongodb/docs/commit/dbf914b5188894591060d53a86daa85d94ef9b2c

Comment by Githook User [ 11/Jan/21 ]

Author:

{'name': 'Dave Cuthbert', 'email': 'dave.cuthbert@mongodb.com', 'username': 'davemungo'}

Message: DOCS-13883 docs for operator
Branch: v5.0
https://github.com/mongodb/docs/commit/12935ac2b98baae3ce2fc0f5f0af98264f5ee9ff

Generated at Thu Feb 08 08:08:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.