diff --git a/samples/document-snippets/family.js b/samples/document-snippets/family.js index 1340fe682..576055ed8 100644 --- a/samples/document-snippets/family.js +++ b/samples/document-snippets/family.js @@ -29,7 +29,7 @@ const snippets = { // let apiResponse = result[1]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_create_family] callback(); @@ -46,7 +46,7 @@ const snippets = { const exists = result[0]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_exists_family] callback(); @@ -63,12 +63,12 @@ const snippets = { // const apiResponse = result[1]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_get_family] callback(); }, - getMetaData: (instanceId, tableId, familyId, callback) => { + getMetadata: (instanceId, tableId, familyId, callback) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); @@ -80,17 +80,17 @@ const snippets = { // const apiResponse = result[1]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_get_family_meta] callback(); }, - setMetaData: (instanceId, tableId, familyId, callback) => { + setMetadata: (instanceId, tableId, familyId, callback) => { const instance = bigtable.instance(instanceId); const table = instance.table(tableId); const family = table.family(familyId); // [START bigtable_set_family_meta] - var metadata = { + const metadata = { rule: { versions: 2, union: true, @@ -102,7 +102,7 @@ const snippets = { const apiResponse = result[0]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_set_family_meta] callback(); @@ -118,7 +118,7 @@ const snippets = { const apiResponse = result[0]; }) .catch(err => { - // handle error + // Handle the error. }); // [END bigtable_del_family] callback(); diff --git a/samples/document-snippets/tests/family.js b/samples/document-snippets/tests/family.js index 3bcdd6603..e086901d6 100644 --- a/samples/document-snippets/tests/family.js +++ b/samples/document-snippets/tests/family.js @@ -1,5 +1,5 @@ /** - * Copyright 2016 Google Inc. All Rights Reserved. + * Copyright 2018 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ const uuid = require(`uuid`); const Bigtable = require(`@google-cloud/bigtable`); const bigtable = new Bigtable(); -const INSTANCE_ID = `sample-instance-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules -const CLUSTER_ID = `sample-cluster-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules -const TABLE_ID = `sample-table-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules +const INSTANCE_ID = `nodejs-bigtable-samples-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules +const CLUSTER_ID = `nodejs-bigtable-samples-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules +const TABLE_ID = `nodejs-bigtable-samples-${uuid.v4()}`.substr(0, 30); // Bigtable naming rules const FAMILY_ID = `sample-family-${uuid.v4()}`.substr(0, 10); // Bigtable naming rules const familySnippets = require('../family.js'); @@ -61,12 +61,12 @@ describe('Family Snippets', function() { familySnippets.getFamily(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); }); - it('should get family meta-data', function(done) { - familySnippets.getMetaData(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should get family metadata', function(done) { + familySnippets.getMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); }); - it('should set family meta-data', function(done) { - familySnippets.setMetaData(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); + it('should set family metadata', function(done) { + familySnippets.setMetadata(INSTANCE_ID, TABLE_ID, FAMILY_ID, done); }); it('should delete family', function(done) {