mod

abstract fun mod(divisor: Long, remainder: Long)(source)

Selects documents where the value of the field divided by divisor has the specified remainder.

If the value of the field is a floating-point number, it is rounded towards zero before the operation.

Example

To find all users with an odd score:

class User(
val name: String,
val age: Int?,
)

collection.find {
User::age { mod(2, 1) }
}

This request returns elements where age % 2 == 1.

External resources