简体   繁体   中英

How to delete all rows in BigTable GCP using nodejs without prefix

I'm trying to delete all rows without a prefix from bigtable using node js but it keeps on throwing error saying Error: A prefix is required for deleteRows ...

Tried this

table.deleteRows(function(err) {
    if (!err) {
      // All rows were deleted successfully.
    }
  })

Try passing in an empty prefix which would match everything like so:

table
  .deleteRows('')
  .then(result => {
    const apiResponse = result[0];
  })
  .catch(err => {
    // Handle the error.
  });

There is an example in the reference docs, prefix seems required https://googleapis.dev/nodejs/bigtable/latest/Table.html#deleteRows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM