BigQuery NodeJS: Delete Rows/DML Support

Viewed 725
1 Answers

If you know how to execute a SELECT query in BigQuery, you do the same to execute a DELETE query.

    const query = `SELECT name
      FROM \`bigquery-public-data.usa_names.usa_1910_2013\`
      WHERE state = 'TX'
      LIMIT 100`;

    // For all options, see https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
    const options = {
      query: query,
      // Location must match that of the dataset(s) referenced in the query.
      location: 'US',
    };

    // Run the query as a job
    const [job] = await bigquery.createQueryJob(options);

Just change the query in that example for DELETE FROM ____ WHERE ____.

Related