node.js - BigQuery : Questions on Delete and Update rows using nodejs

标签 node.js google-bigquery

我找到了很多用于查询数据并将数据插入 BigQuery 的 node.js 示例,但没有找到有关如何删除和更新数据库中的行的任何示例或 API 说明。我知道这些限制(距离上次更改后 30 分钟等)。

我发现的唯一提示是从 vscode

bigQuery.dataset(dataset).table(table).deleteFromBigQuery('noIdea') 

但即使是 vscode 也无法给我有关更新的提示。

你知道这方面的 nodejs 文档吗?

我一直在寻找的一些资源 query examples by googleapisDMLs google Manual

最佳答案

建立在sync_query example之上:

async function runDeleteQuery(projectId) {
  // Imports the Google Cloud client library
  const BigQuery = require('@google-cloud/bigquery');

  /**
   * TODO(developer): Uncomment the following line before running the sample.
   */
  // const projectId = "your-project-id";

  // Modify this query however you need
  const sqlQuery = "DELETE FROM dataset.table WHERE condition;";

  // Creates a client
  const bigquery = new BigQuery({projectId});

  // Query options list: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query
  const options = {
    query: sqlQuery,
    timeoutMs: 100000, // Time out after 100 seconds.
    useLegacySql: false, // Use standard SQL syntax for queries.
  };

  // Runs the query
  await bigquery.query(options);
}

另请参阅DELETE statement documentation .

关于node.js - BigQuery : Questions on Delete and Update rows using nodejs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52672242/

相关文章:

sql - BigQuery : Format ISO Date

sql - 如何计算 session 持续时间和平均值。 Google Analytics 原始数据中的 session 持续时间?

javascript - 引用错误 : self is not defined

javascript - 使用 req.data 将值从中间件传递到 Restify 中的 Controller 不起作用?

javascript - 流利的 ffmpeg h264 到 gif throw "error 1"

google-bigquery - BigQuery NEST() 返回 'Error: An internal error occurred'

google-bigquery - BigQuery 无法从 CSV 文件中解析 M/D/YYYY 格式的日期

java - 使用TableRowJsonCoder将PubSub消息转换为BEAM中的TableRow

javascript - MongoDB 通过不区分大小写的正则表达式跟踪集合中的索引

javascript - 未使用异步定义回调