【问题标题】:How to set the column family when inserting a row in BigtableBigtable插入行时如何设置列族
【发布时间】:2020-09-26 02:35:55
【问题描述】:

我想在 Bigtable 中插入一行,我试过这个简单的代码

const rowToInsert = {
  key: `${tenantId}:${customerId}`,
  data: personalInfo
};

await table.insert(rowToInsert);

但我得到了

Error while mutating the row '999:customerId' : Requested column family not found.

列族存在,那么如何设置这个插入的列族呢? 我在文档中看到了this 示例,我不清楚

【问题讨论】:

    标签: node.js google-api insert google-cloud-bigtable bigtable


    【解决方案1】:

    Cloud Bigtable Writing Data documentation 展示了如何执行各种写入

    data: {
      [COLUMN_FAMILY_ID]: {
        [COLUMN_QUALIFIER]: {
          // Setting the timestamp allows the client to perform retries. If
          // server-side time is used, retries may cause multiple cells to
          // be generated.
          timestamp: new Date(),
          value: greeting,
        },
      },
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-26
      • 2018-03-09
      • 2017-06-12
      • 2014-05-05
      • 1970-01-01
      • 2018-12-22
      • 1970-01-01
      • 2018-02-21
      相关资源
      最近更新 更多