- Reference >
- Operators >
- Aggregation Pipeline Operators >
- $divide (aggregation)
$divide (aggregation)¶
On this page
Definition¶
-
$divide
¶ Divides one number by another and returns the result. Pass the arguments to
$divide
in an array.The
$divide
expression has the following syntax:The first argument is the dividend, and the second argument is the divisor; i.e. the first argument is divided by the second argument.
The arguments can be any valid expression as long as they resolve to numbers. For more information on expressions, see Expressions.