【问题标题】:Airtable returns not all records via APIAirtable 并非通过 API 返回所有记录
【发布时间】:2021-11-15 18:06:18
【问题描述】:

我确实通过他们的 API 加载 aittable 记录:

  const base = airtable.base(item.baseId);

  base("Dishes")
    .select({
    })
    .eachPage(
      function page(records, fetchNextPage) {
        tableRecords.push(...records);

        // To fetch the next page of records, call `fetchNextPage`.
        // If there are more records, `page` will get called again.
        // If there are no more records, `done` will get called.
        fetchNextPage();
      },
      function done(err) {
        if (err) {
          console.error(err);
          return;
        }
        console.log("@@Done", tableRecords.length);
      }
    );

因此,我收到了 2202 条记录。但在 UI 的表格中,我确实看到了 2271 条记录。当我导出到 csv 时,我也看到了相同的 2271。

代码非常基本,我什至删除了view 设置以确保这不是一个演示问题。

Google 没有帮助我(没有任何关系)。有没有人面临同样的问题?有什么解决办法吗?

注意:当然,我已经比较了两个列表并找到了我确实错过的项目,但是在观察这些项目时,我发现那里没有什么特别之处。所以它说我what我确实想念,但不是why

【问题讨论】:

标签: airtable


【解决方案1】:

const base = airtable.base(item.baseId);

base("Dishes")
  .select({})
  .all()

【讨论】:

  • ``` (node:21094) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'offset' of undefined at /Users/vvscode/repo/airtableExport/node_modules/airtable/src/query.ts:162: 28 在 /Users/vvscode/repo/airtableExport/node_modules/airtable/src/run_action.ts:90:25 在 processTicksAndRejections (internal/process/task_queues.js:95:5) ```
  • 即使我在这些行中添加了检查 - 我确实在输出中收到 null
  • 今年早些时候似乎出现了这个问题:github.com/Airtable/airtable.js/issues/246
  • 所以它建议切换回我最初拥有的 eachPage
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-26
  • 2011-07-02
  • 1970-01-01
  • 1970-01-01
  • 2021-12-20
相关资源
最近更新 更多