Skip to content

Commit

Permalink
more update to sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay-qlogic committed Aug 27, 2018
1 parent 632214e commit b6c0279
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions samples/document-snippets/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,14 @@ const snippets = {
// [START bigtable_delete_particular_cells]
const row = table.row('samplerow');

// Delete selective cell within a family.
// let cells = [
// 'follows:gwashington'
// ];

// Delete all cells within a family.
let cells = ['follows'];

row
.deleteCells(cells)
.then(result => {
Expand Down Expand Up @@ -202,6 +208,23 @@ const snippets = {
.catch(err => {
// handle error
});

//-
// Or pass in an array of column names to populate specific cells.
// Under the hood this will create an interleave filter.
//-
// row
// .get([
// 'follows:gwashington',
// 'follows:alincoln'
// ])
// .then(result => {
// let row = result[0];
// })
// .catch(err => {
// // handle error
// });

// [END bigtable_get_row]

callback();
Expand Down Expand Up @@ -236,10 +259,20 @@ const snippets = {
const row = table.row('samplerow');

// Specify a custom amount to increment the column by.
// row.increment('follows:gwashington', 2);
// row
// .increment('follows:gwashington', 2)
// .then(result => {
// let value = result[0];
// let apiResponse = result[1];
// });

// To decrement a column, simply supply a negative value.
// row.increment('follows:gwashington', -1);
// row
// .increment('follows:gwashington', -1)
// .then(result => {
// let value = result[0];
// let apiResponse = result[1];
// });
row
.increment('follows:gwashington')
.then(result => {
Expand Down

0 comments on commit b6c0279

Please sign in to comment.