mongosh
mongo
Docs Home → Develop Applications → MongoDB Manual
_rand()
0
1
This function provides functionality similar to the Math.rand() function from the standard library.
Math.rand()