Create a Row object to interact with your table rows.
Package
@google-cloud/bigtableExample
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
:
TabularApiSurface
,
key
:
string
);
Constructs a new instance of the Row
class
table
TabularApiSurface
key
string
Properties
bigtable
bigtable
:
Bigtable
;
data
data
:
any
;
id
id
:
string
;
key
key
?:
string
;
metadata
metadata
?:
{};
table
table
:
TabularApiSurface
;
Methods
create(options)
create
(
options
?:
CreateRowOptions
)
:
Promise<CreateRowResponse>
;
create(options, callback)
create
(
options
:
CreateRowOptions
,
callback
:
CreateRowCallback
)
:
void
;
void
create(callback)
create
(
callback
:
CreateRowCallback
)
:
void
;
void
createRules(rules, options)
createRules
(
rules
:
Rule
|
Rule
[],
options
?:
CallOptions
)
:
Promise<CreateRulesResponse>
;
createRules(rules, options, callback)
createRules
(
rules
:
Rule
|
Rule
[],
options
:
CallOptions
,
callback
:
CreateRulesCallback
)
:
void
;
void
createRules(rules, callback)
createRules
(
rules
:
Rule
|
Rule
[],
callback
:
CreateRulesCallback
)
:
void
;
void
delete(options)
delete
(
options
?:
CallOptions
)
:
Promise<MutateResponse>
;
options
CallOptions
delete(options, callback)
delete
(
options
:
CallOptions
,
callback
:
MutateCallback
)
:
void
;
void
delete(callback)
delete
(
callback
:
MutateCallback
)
:
void
;
void
deleteCells(columns, options)
deleteCells
(
columns
:
string
[],
options
?:
CallOptions
)
:
Promise<MutateResponse>
;
columns
string[]
options
CallOptions
deleteCells(columns, options, callback)
deleteCells
(
columns
:
string
[],
options
:
CallOptions
,
callback
:
MutateCallback
)
:
void
;
void
deleteCells(columns, callback)
deleteCells
(
columns
:
string
[],
callback
:
MutateCallback
)
:
void
;
void
exists(options)
exists
(
options
?:
CallOptions
)
:
Promise<RowExistsResponse>
;
options
CallOptions
exists(options, callback)
exists
(
options
:
CallOptions
,
callback
:
RowExistsCallback
)
:
void
;
void
exists(callback)
exists
(
callback
:
RowExistsCallback
)
:
void
;
void
filter(filter, config)
filter
(
filter
:
RawFilter
,
config
?:
FilterConfig
)
:
Promise<FilterResponse>
;
filter(filter, config, callback)
filter
(
filter
:
RawFilter
,
config
:
FilterConfig
,
callback
:
FilterCallback
)
:
void
;
void
filter(filter, callback)
filter
(
filter
:
RawFilter
,
callback
:
FilterCallback
)
:
void
;
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.
chunks
options
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.
families
options
{
[index: string]: {};
}
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>
> ;
get(columns, options)
get<T
=
any
> (
columns
:
string
[],
options
?:
GetRowOptions
)
:
Promise<GetRowResponse<T>
> ;
T
get(columns, options, callback)
get<T
=
any
> (
columns
:
string
[],
options
:
GetRowOptions
,
callback
:
GetRowCallback<T>
)
:
void
;
void
T
get(columns, callback)
get<T
=
any
> (
columns
:
string
[],
callback
:
GetRowCallback<T>
)
:
void
;
void
T
get(callback)
get
(
callback
:
GetRowCallback<Row>
)
:
void
;
void
get(options, callback)
get
(
options
:
GetRowOptions
,
callback
:
GetRowCallback<Row>
)
:
void
;
void
getMetadata(options)
getMetadata
(
options
?:
GetRowOptions
)
:
Promise<GetRowMetadataResponse>
;
getMetadata(options, callback)
getMetadata
(
options
:
GetRowOptions
,
callback
:
GetRowMetadataCallback
)
:
void
;
void
getMetadata(callback)
getMetadata
(
callback
:
GetRowMetadataCallback
)
:
void
;
void
increment(column, value)
increment
(
column
:
string
,
value
?:
number
)
:
Promise<IncrementResponse>
;
column
string
value
number
increment(column, value, options)
increment
(
column
:
string
,
value
:
number
,
options
?:
CallOptions
)
:
Promise<IncrementResponse>
;
column
string
value
number
options
CallOptions
increment(column, options)
increment
(
column
:
string
,
options
?:
CallOptions
)
:
Promise<IncrementResponse>
;
column
string
options
CallOptions
increment(column, value, options, callback)
increment
(
column
:
string
,
value
:
number
,
options
:
CallOptions
,
callback
:
IncrementCallback
)
:
void
;
column
string
value
number
options
CallOptions
callback
void
increment(column, value, callback)
increment
(
column
:
string
,
value
:
number
,
callback
:
IncrementCallback
)
:
void
;
void
increment(column, options, callback)
increment
(
column
:
string
,
options
:
CallOptions
,
callback
:
IncrementCallback
)
:
void
;
void
increment(column, callback)
increment
(
column
:
string
,
callback
:
IncrementCallback
)
:
void
;
void
save(entry, options)
save
(
entry
:
Entry
,
options
?:
CallOptions
)
:
Promise<MutateResponse>
;
save(entry, options, callback)
save
(
entry
:
Entry
,
options
:
CallOptions
,
callback
:
MutateCallback
)
:
void
;
void
save(entry, callback)
save
(
entry
:
Entry
,
callback
:
MutateCallback
)
:
void
;
void