标签: leancloud

  • LeanCloud 笔记

    慢慢记。

    慎用 await Promise.all(items.map(item => ....))

    很容易造成 409 too many requests 问题。

    最好用

    const newItems = [];
    for (const item of items) {
      item = await doSomeAsyncJob();
      newItems.push(item);
    }

    Pointer 时尽量用 query

    取单一对象的时候,方法有很多,比如 createWithoutData + fetch。不过如果如果对象内部属性有 Pointer,且我们希望一次性把 Pointer 取回来的话,最好用 query,因为只有它支持 .include(),可以一次性拉取全部需要的数据,减少请求次数,减少发生 too many requests 的可能。