Back to main page

$mod

Concept:

Select documents where the value of a field divided by a divisor has the specified remainder (i.e. perform a modulo operation to select documents)

Format:

    {
      "$mod" : { "divisor" : long, "remainder" : long } | 
               [ long(divisor), long(remainder) ]
    }