Row
Source: row.
Create a Row object to interact with your table rows.
Methods
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
|
||||||||||||||||
|
callback |
function() |
|
The callback function. Values in
|
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
|
- Throws
-
errorIf 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
|
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
|
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
|
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 to be applied to the contents of the row. |
|||||||||||||||||
|
config |
object |
|
Configuration object. Values in
|
||||||||||||||||
|
callback |
function() |
|
The callback function. Values in
|
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
|
||||||||||||
|
callback |
function() |
|
The callback function. Values in
|
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
|
||||||||||||
|
callback |
function() |
|
The callback function. Values in
|
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
|
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
|