$decimal
Returns a random BSON Decimal128 number.
Aliases: $decimal
, $decimal128
, $mgNumberDecimal
Options¶
min
(optional) minimum value. Default0
.max
(optional) maximum value. Default1000
.fixed
(optional) number of digits after the decimal. Default2
.
Example¶
{
"price": {
"$decimal": {
"fixed": 3
}
}
}
{
"price": {
"$numberDecimal": "545.241"
}
}
{
"price": NumberDecimal("545.241")
}