Delete rows with mutate

Delete rows using mutate.

Code sample


To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

namespace cbt = ::google::cloud::bigtable;
[](cbt::Table table, std::vector<std::string> const& keys) {
  cbt::BulkMutation mutation;
  for (auto const& row_key : keys) {
        cbt::SingleRowMutation(row_key, cbt::DeleteFromRow()));
  std::vector<cbt::FailedMutation> failures =
  if (failures.empty()) {
    std::cout << "All rows successfully deleted\n";
  std::cerr << "The following mutations failed:\n";
  for (auto const& f : failures) {
    std::cerr << "index[" << f.original_index() << "]=" << f.status() << "\n";

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.