云开发正则表达式
发布于 6 年前 作者 yong80 13086 次浏览 来自 问答
  • 需求的场景描述(希望解决的问题)

const countResult = await db.collection(event.part).where({   

    “Part No”: db.RegExp({

      regexp: ‘M051*’,

      options: ‘i’,

    }),   

  }).count({

    success: function (res) {

      console.log(res.total)

    }

  })

为何结果把M052LDN也搜出来了?

  • 希望提供的能力
1 回复

你需要的应该是 ‘M051.*’ 吧?(有个 .)

回到顶部