mongodb / v3.6 / reference / reference-method-rand.html

_rand()

  • _rand ( )
Returns: 介于01之间的随机数。

此功能提供的功能类似于标准库中的Math.rand()功能。