new Row(table, key)

Example

const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const table = instance.table('prezzy');
const row = table.row('gwashington');

Parameters

Name Type Optional Description

table

 

 

The row's parent Table instance.

key

 

 

The key for this row.

Methods

create([options], callback)

Create a new row in your table.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_create_row

Parameters

Name Type Optional Description

options

object

Yes

Configuration object.

Values in options have the following properties:

Name Type Optional Description

entry

object

Yes

An entry. See Table#insert.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

row

Row

 

The newly created row object.

apiResponse

object

 

The full API response.

createRules(rules[, gaxOptions], callback)

Update a row with rules specifying how the row's contents are to be transformed into writes. Rules are applied in order, meaning that earlier rules will affect the results of later ones.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_create_rules

Parameters

Name Type Optional Description

rules

(object or Array of object)

 

The rules to apply to this row.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.

Throws

error 

If no rules are provided.

delete([gaxOptions], callback)

Deletes all cells in the row.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_delete_all_cells

Parameters

Name Type Optional Description

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.

deleteCells(columns[, gaxOptions], callback)

Delete specified cells from the row. See Table#mutate.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_delete_particular_cells

Parameters

Name Type Optional Description

columns

Array of string

 

Column names for the cells to be deleted.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.

exists([gaxOptions], callback)

Check if the table row exists.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_row_exists

Parameters

Name Type Optional Description

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

exists

boolean

 

Whether the row exists or not.

filter(filter, config, callback)

Mutates a row atomically based on the output of a filter. Depending on whether or not any results are yielded, either the onMatch or onNoMatch callback will be executed.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_row_filter

Parameters

Name Type Optional Description

filter

Filter

 

Filter to be applied to the contents of the row.

config

object

 

Configuration object.

Values in config have the following properties:

Name Type Optional Description

onMatch

Array of object

 

A list of entries to be ran if a match is found.

Value can be null.

onNoMatch

Array of object

Yes

A list of entries to be ran if no matches are found.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

matched

boolean

 

Whether a match was found or not.

get([columns][, options], callback)

Get the row data. See Table#getRows.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_get_row

Parameters

Name Type Optional Description

columns

Array of string

Yes

List of specific columns to retrieve.

options

object

Yes

Configuration object.

Values in options have the following properties:

Name Type Optional Description

decode

boolean

Yes

If set to false it will not decode Buffer values returned from Bigtable.

Defaults to true.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

row

Row

 

The updated Row object.

getMetadata([options], callback)

Get the row's metadata.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_get_row_meta

Parameters

Name Type Optional Description

options

object

Yes

Configuration object.

Values in options have the following properties:

Name Type Optional Description

decode

boolean

Yes

If set to false it will not decode Buffer values returned from Bigtable.

Defaults to true.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

metadata

object

 

The row's metadata.

increment(column[, value][, gaxOptions], callback)

Increment a specific column within the row. If the column does not exist, it is automatically initialized to 0 before being incremented.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_row_increment

Parameters

Name Type Optional Description

column

string

 

The column we are incrementing a value in.

value

number

Yes

The amount to increment by, defaults to 1.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

value

number

 

The updated value of the column.

apiResponse

object

 

The full API response.

save(key[, gaxOptions], callback)

Update the row cells.

Example

include:samples/document-snippets/row.js

region_tag:bigtable_row_save

Parameters

Name Type Optional Description

key

object

 

An entry object to be inserted into the row. See Table#insert.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.