Row

Row

Create a Row object to interact with your table rows.

Constructor

new Row(table, key)

Parameters:
Name Type Description
table Table

The row's parent Table instance.

key string

The key for this row.

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');
```

Methods

create(optionsopt, callback)

Create a new row in your table.

Parameters:
Name Type Attributes Description
options object <optional>

Configuration object.

Properties
Name Type Attributes Description
entry object <optional>

An entry. See Table#insert.

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

row Row

The newly created row object.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_create_row

createRules(rules, gaxOptionsopt, 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.

Parameters:
Name Type Attributes Description
rules object | Array.<object>

The rules to apply to this row.

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Throws:

If no rules are provided.

Type
error
Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_create_rules

delete(gaxOptionsopt, callback)

Deletes all cells in the row.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_delete_all_cells

deleteCells(columns, gaxOptionsopt, callback)

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

Parameters:
Name Type Attributes Description
columns Array.<string>

Column names for the cells to be deleted.

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_delete_particular_cells

exists(gaxOptionsopt, callback)

Check if the table row exists.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

exists boolean

Whether the row exists or not.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_row_exists

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.

Parameters:
Name Type Description
filter Filter

Filter to be applied to the contents of the row.

config object

Configuration object.

Properties
Name Type Attributes Description
onMatch Array.<object> <nullable>

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

onNoMatch Array.<object> <optional>

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

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

matched boolean

Whether a match was found or not.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_row_filter

get(columnsopt, optionsopt, callback)

Get the row data. See Table#getRows.

Parameters:
Name Type Attributes Description
columns Array.<string> <optional>

List of specific columns to retrieve.

options object <optional>

Configuration object.

Properties
Name Type Attributes Default Description
decode boolean <optional>
true

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

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

row Row

The updated Row object.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_get_row

getMetadata(optionsopt, callback)

Get the row's metadata.

Parameters:
Name Type Attributes Description
options object <optional>

Configuration object.

Properties
Name Type Attributes Default Description
decode boolean <optional>
true

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

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

metadata object

The row's metadata.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_get_row_meta

increment(column, valueopt, gaxOptionsopt, callback)

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

Parameters:
Name Type Attributes Description
column string

The column we are incrementing a value in.

value number <optional>

The amount to increment by, defaults to 1.

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

value number

The updated value of the column.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_row_increment

save(key, gaxOptionsopt, callback)

Update the row cells.

Parameters:
Name Type Attributes Description
key object

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

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/row.js

region_tag:bigtable_api_row_save