我遇到了以下问题,但是不知道应该怎么样去构建代码:

定时任务:每日 0 点清空 class: Plan 中的计数器属性 todayTomatoNumber

目前我是这样子写的定时函数:

const planList = await new AV.Query(Plan)
  .notEqualTo("todayTomatoNumber", 0)
  .limit(1000)
  .find();

planList.forEach(plan => {
  plan.set("todayTomatoNumber", 0);
});

但是如果返回结果超过 1000 就不知道该咋办了,看到说 skip 会影响性能,官方是否有基于 createdAt 进行全部查询的最佳实践呢?

感谢子亭回复,我去看看,在下老粉丝了