@google-cloud/bigtable

The default export of the @google-cloud/bigtable package is the Bigtable class.

See Bigtable and ClientConfig for client methods and configuration options.

Examples

Install the client library with npm:

npm install --save @google-cloud/bigtable

Import the client library

const {Bigtable} = require('@google-cloud/bigtable');

Create a client that uses Application Default Credentials (ADC):

const bigtable = new Bigtable();

Create a client with explicit credentials:

const bigtable = new Bigtable({
  projectId: 'your-project-id',
  keyFilename: '/path/to/keyfile.json'
});

Full quickstart example:

  // Imports the Google Cloud client library
  const {Bigtable} = require('@google-cloud/bigtable');

  const bigtable = new Bigtable();

  async function quickstart() {
    // Connect to an existing instance:my-bigtable-instance
    const instance = bigtable.instance(INSTANCE_ID);

    // Connect to an existing table:my-table
    const table = instance.table(TABLE_ID);

    // Read a row from my-table using a row key
    const [singleRow] = await table.row('r1').get();

    // Print the row key and data (column value, labels, timestamp)
    const rowData = JSON.stringify(singleRow.data, null, 4);
    console.log(`Row key: ${singleRow.id}\nData: ${rowData}`);
  }
  quickstart();

Members

AppProfile

Reference to the AppProfile class.

See:

Backup

Reference to the Backup class.

See:

Cluster

Reference to the Cluster class.

See:

Instance

Reference to the Instance class.

See: