Class Row (5.0.0)

Create a Row object to interact with your table rows.

Package

@google-cloud/bigtable

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

Constructors

(constructor)(table, key)

constructor(table: Table, key: string);

Constructs a new instance of the Row class

Parameters
NameDescription
table Table
key string

Properties

bigtable

bigtable: Bigtable;

data

data: any;

id

id: string;

key

key?: string;

metadata

metadata?: {};

table

table: Table;

Methods

create(options)

create(options?: CreateRowOptions): Promise<CreateRowResponse>;
Parameter
NameDescription
options CreateRowOptions
Returns
TypeDescription
Promise<CreateRowResponse>

create(options, callback)

create(options: CreateRowOptions, callback: CreateRowCallback): void;
Parameters
NameDescription
options CreateRowOptions
callback CreateRowCallback
Returns
TypeDescription
void

create(callback)

create(callback: CreateRowCallback): void;
Parameter
NameDescription
callback CreateRowCallback
Returns
TypeDescription
void

createRules(rules, options)

createRules(rules: Rule | Rule[], options?: CallOptions): Promise<CreateRulesResponse>;
Parameters
NameDescription
rules Rule | Rule[]
options CallOptions
Returns
TypeDescription
Promise<CreateRulesResponse>

createRules(rules, options, callback)

createRules(rules: Rule | Rule[], options: CallOptions, callback: CreateRulesCallback): void;
Parameters
NameDescription
rules Rule | Rule[]
options CallOptions
callback CreateRulesCallback
Returns
TypeDescription
void

createRules(rules, callback)

createRules(rules: Rule | Rule[], callback: CreateRulesCallback): void;
Parameters
NameDescription
rules Rule | Rule[]
callback CreateRulesCallback
Returns
TypeDescription
void

delete(options)

delete(options?: CallOptions): Promise<MutateResponse>;
Parameter
NameDescription
options CallOptions
Returns
TypeDescription
Promise<MutateResponse>

delete(options, callback)

delete(options: CallOptions, callback: MutateCallback): void;
Parameters
NameDescription
options CallOptions
callback MutateCallback
Returns
TypeDescription
void

delete(callback)

delete(callback: MutateCallback): void;
Parameter
NameDescription
callback MutateCallback
Returns
TypeDescription
void

deleteCells(columns, options)

deleteCells(columns: string[], options?: CallOptions): Promise<MutateResponse>;
Parameters
NameDescription
columns string[]
options CallOptions
Returns
TypeDescription
Promise<MutateResponse>

deleteCells(columns, options, callback)

deleteCells(columns: string[], options: CallOptions, callback: MutateCallback): void;
Parameters
NameDescription
columns string[]
options CallOptions
callback MutateCallback
Returns
TypeDescription
void

deleteCells(columns, callback)

deleteCells(columns: string[], callback: MutateCallback): void;
Parameters
NameDescription
columns string[]
callback MutateCallback
Returns
TypeDescription
void

exists(options)

exists(options?: CallOptions): Promise<RowExistsResponse>;
Parameter
NameDescription
options CallOptions
Returns
TypeDescription
Promise<RowExistsResponse>

exists(options, callback)

exists(options: CallOptions, callback: RowExistsCallback): void;
Parameters
NameDescription
options CallOptions
callback RowExistsCallback
Returns
TypeDescription
void

exists(callback)

exists(callback: RowExistsCallback): void;
Parameter
NameDescription
callback RowExistsCallback
Returns
TypeDescription
void

filter(filter, config)

filter(filter: RawFilter, config?: FilterConfig): Promise<FilterResponse>;
Parameters
NameDescription
filter RawFilter
config FilterConfig
Returns
TypeDescription
Promise<FilterResponse>

filter(filter, config, callback)

filter(filter: RawFilter, config: FilterConfig, callback: FilterCallback): void;
Parameters
NameDescription
filter RawFilter
config FilterConfig
callback FilterCallback
Returns
TypeDescription
void

filter(filter, callback)

filter(filter: RawFilter, callback: FilterCallback): void;
Parameters
NameDescription
filter RawFilter
callback FilterCallback
Returns
TypeDescription
void

formatChunks_(chunks, options)

static formatChunks_(chunks: Chunk[], options?: ConvertFromBytesUserOptions): Row[];

Formats the row chunks into friendly format. Chunks contain 3 properties:

rowContents The row contents, this essentially is all data pertaining to a single family.

commitRow This is a boolean telling us the all previous chunks for this row are ok to consume.

resetRow This is a boolean telling us that all the previous chunks are to be discarded.

Parameters
NameDescription
chunks Chunk[]

The list of chunks.

options ConvertFromBytesUserOptions

Formatting options.

Returns
TypeDescription
Row[]
Example

Row.formatChunks_(chunks);
// {
//   follows: {
//     gwashington: [
//       {
//         value: 2
//       }
//     ]
//   }
// }

formatFamilies_(families, options)

static formatFamilies_(families: google.bigtable.v2.IFamily[], options?: FormatFamiliesOptions): {
        [index: string]: {};
    };

Formats a rowContents object into friendly format.

Parameters
NameDescription
families google.bigtable.v2.IFamily[]

The row families.

options FormatFamiliesOptions

Formatting options.

Returns
TypeDescription
{ [index: string]: {}; }
Example

const families = [
  {
    name: 'follows',
    columns: [
      {
        qualifier: 'gwashington',
        cells: [
          {
            value: 2
          }
        ]
      }
    ]
  }
];

Row.formatFamilies_(families);
// {
//   follows: {
//     gwashington: [
//       {
//         value: 2
//       }
//     ]
//   }
// }

get(options)

get(options?: GetRowOptions): Promise<GetRowResponse<Row>>;
Parameter
NameDescription
options GetRowOptions
Returns
TypeDescription
Promise<GetRowResponse<Row>>

get(columns, options)

get<T = any>(columns: string[], options?: GetRowOptions): Promise<GetRowResponse<T>>;
Parameters
NameDescription
columns string[]
options GetRowOptions
Returns
TypeDescription
Promise<GetRowResponse<T>>
Type Parameter
NameDescription
T

get(columns, options, callback)

get<T = any>(columns: string[], options: GetRowOptions, callback: GetRowCallback<T>): void;
Parameters
NameDescription
columns string[]
options GetRowOptions
callback GetRowCallback<T>
Returns
TypeDescription
void
Type Parameter
NameDescription
T

get(columns, callback)

get<T = any>(columns: string[], callback: GetRowCallback<T>): void;
Parameters
NameDescription
columns string[]
callback GetRowCallback<T>
Returns
TypeDescription
void
Type Parameter
NameDescription
T

get(callback)

get(callback: GetRowCallback<Row>): void;
Parameter
NameDescription
callback GetRowCallback<Row>
Returns
TypeDescription
void

get(options, callback)

get(options: GetRowOptions, callback: GetRowCallback<Row>): void;
Parameters
NameDescription
options GetRowOptions
callback GetRowCallback<Row>
Returns
TypeDescription
void

getMetadata(options)

getMetadata(options?: GetRowOptions): Promise<GetRowMetadataResponse>;
Parameter
NameDescription
options GetRowOptions
Returns
TypeDescription
Promise<GetRowMetadataResponse>

getMetadata(options, callback)

getMetadata(options: GetRowOptions, callback: GetRowMetadataCallback): void;
Parameters
NameDescription
options GetRowOptions
callback GetRowMetadataCallback
Returns
TypeDescription
void

getMetadata(callback)

getMetadata(callback: GetRowMetadataCallback): void;
Parameter
NameDescription
callback GetRowMetadataCallback
Returns
TypeDescription
void

increment(column, value)

increment(column: string, value?: number): Promise<IncrementResponse>;
Parameters
NameDescription
column string
value number
Returns
TypeDescription
Promise<IncrementResponse>

increment(column, value, options)

increment(column: string, value: number, options?: CallOptions): Promise<IncrementResponse>;
Parameters
NameDescription
column string
value number
options CallOptions
Returns
TypeDescription
Promise<IncrementResponse>

increment(column, options)

increment(column: string, options?: CallOptions): Promise<IncrementResponse>;
Parameters
NameDescription
column string
options CallOptions
Returns
TypeDescription
Promise<IncrementResponse>

increment(column, value, options, callback)

increment(column: string, value: number, options: CallOptions, callback: IncrementCallback): void;
Parameters
NameDescription
column string
value number
options CallOptions
callback IncrementCallback
Returns
TypeDescription
void

increment(column, value, callback)

increment(column: string, value: number, callback: IncrementCallback): void;
Parameters
NameDescription
column string
value number
callback IncrementCallback
Returns
TypeDescription
void

increment(column, options, callback)

increment(column: string, options: CallOptions, callback: IncrementCallback): void;
Parameters
NameDescription
column string
options CallOptions
callback IncrementCallback
Returns
TypeDescription
void

increment(column, callback)

increment(column: string, callback: IncrementCallback): void;
Parameters
NameDescription
column string
callback IncrementCallback
Returns
TypeDescription
void

save(entry, options)

save(entry: Entry, options?: CallOptions): Promise<MutateResponse>;
Parameters
NameDescription
entry Entry
options CallOptions
Returns
TypeDescription
Promise<MutateResponse>

save(entry, options, callback)

save(entry: Entry, options: CallOptions, callback: MutateCallback): void;
Parameters
NameDescription
entry Entry
options CallOptions
callback MutateCallback
Returns
TypeDescription
void

save(entry, callback)

save(entry: Entry, callback: MutateCallback): void;
Parameters
NameDescription
entry Entry
callback MutateCallback
Returns
TypeDescription
void