- Reference >
- Operators >
- Aggregation Pipeline Operators >
- $mod (aggregation)
$mod (aggregation)¶
On this page
Definition¶
-
$mod
¶ Divides one number by another and returns the remainder.
The
$mod
expression has the following syntax:The first argument is the dividend, and the second argument is the divisor; i.e. 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.