Row
Create a Row object to interact with your table rows.
Constructor
Row
new Row(table, key)
Parameter |
|
---|---|
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
create(options, callback)
Create a new row in your table.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
options |
Optional object Configuration object. Values in
|
||||||||
callback |
function() The callback function. Values in
|
Examples
createRules
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.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
rules |
(object or Array of object) The rules to apply to this row. |
||||||
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||
callback |
function() The callback function. Values in
|
- Throws
-
error
If no rules are provided.
Examples
delete
delete(gaxOptions, callback)
Deletes all cells in the row.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||
callback |
function() The callback function. Values in
|
Examples
deleteCells
deleteCells(columns, gaxOptions, callback)
Delete specified cells from the row. See Table#mutate.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
columns |
Array of string Column names for the cells to be deleted. |
||||||
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||
callback |
function() The callback function. Values in
|
Examples
exists
exists(gaxOptions, callback)
Check if the table row exists.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||
callback |
function() The callback function. Values in
|
Examples
filter
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.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
filter |
Filter to be applied to the contents of the row. |
||||||||
config |
object Configuration object. Values in
|
||||||||
callback |
function() The callback function. Values in
|
Examples
get
get(columns, options, callback)
Get the row data. See Table#getRows.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
columns |
Optional Array of string List of specific columns to retrieve. |
||||||
options |
Optional object Configuration object. Values in
|
||||||
callback |
function() The callback function. Values in
|
Examples
getMetadata
getMetadata(options, callback)
Get the row's metadata.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
options |
Optional object Configuration object. Values in
|
||||||
callback |
function() The callback function. Values in
|
Examples
increment
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.
Parameter |
|||||||||
---|---|---|---|---|---|---|---|---|---|
column |
string The column we are incrementing a value in. |
||||||||
value |
Optional number The amount to increment by, defaults to 1. |
||||||||
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||||
callback |
function() The callback function. Values in
|
Examples
save
save(key, gaxOptions, callback)
Update the row cells.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
key |
object An entry object to be inserted into the row. See Table#insert. |
||||||
gaxOptions |
Optional object Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html. |
||||||
callback |
function() The callback function. Values in
|