BigQuery:有关使用 nodejs 删除和更新行的问题



我找到了很多node.js示例来查询数据并将其插入 BigQuery,但没有找到有关如何删除和更新数据库中行的任何示例或 API 描述。我知道限制(自上次更改以来的 30 分钟等(。

我从vscode那里得到的唯一提示

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

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

你知道任何关于此nodejs文档吗?

我一直在寻找的一些资源 谷歌API和查询示例 DMLs 谷歌手册

sync_query示例为基础:

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 语句文档。

最新更新