$floor
Rounds a numeric expression down to the nearest integer.
Syntax
{ "$floor": <numberExpression> }
Example
Input
{ "measurement": 7.98 }
Stage
{ "$project": { "roundedDown": { "$floor": "$measurement" } } }
Output
{ "roundedDown": 7 }
Rounds a numeric expression down to the nearest integer.
{ "$floor": <numberExpression> }
{ "measurement": 7.98 }
{ "$project": { "roundedDown": { "$floor": "$measurement" } } }
{ "roundedDown": 7 }