Skip to content

$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 }