Command.size(value: string): Command

支持端:小程序 2.8.3 起, 云函数 1.2.1

更新操作符,用于数组字段的查询筛选条件,要求数组长度为给定值

参数

value: string

返回值

Command

示例

找出 tags 数组字段长度为 2 的所有记录

  1. const _ = db.command
  2. db.collection('todos').where({
  3. places: _.size(2)
  4. })
  5. .get({
  6. success: console.log,
  7. fail: console.error,
  8. })