Command.mod(divisor: number, remainder: number): Command

View Markdown

Last edited on 2026-07-04

Supported on: Mini Program 2.8.3, Cloud Function 1.2.1, Web

Query filter operator. Given a divisor divisor and a remainder remainder, it requires that when the field value is used as the dividend, value % divisor equals remainder.

Parameters

divisor: number

remainder: number

Return Value

Command

Sample Code

Find records where the field is a multiple of 10

const _ = db.command
db.collection('todos').where({
  progress: _.mod(10, 0)
})
.get({
  success: console.log,
  fail: console.error
})