new Family(table, id)

Example

const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const table = instance.table('prezzy');
const family = table.family('follows');

Parameters

Name Type Optional Description

table

 

 

id

 

 

Methods

create([options], callback)

Create a column family.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_create_family

Parameters

Name Type Optional Description

options

object

Yes

See Table#createFamily.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

family

Family

 

The metadata.

apiResponse

object

 

The full API response.

delete([gaxOptions][, callback])

Delete the column family.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_del_family

Parameters

Name Type Optional Description

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

Yes

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.

exists([gaxOptions], callback)

Check if the column family exists.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_exists_family

Parameters

Name Type Optional Description

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

exists

boolean

 

Whether the family exists or not.

get([options])

Get a column family if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_get_family

Parameters

Name Type Optional Description

options

object

Yes

Configuration object.

Values in options have the following properties:

Name Type Optional Description

autoCreate

boolean

Yes

Automatically create the instance if it does not already exist.

Defaults to false.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback.error

error

 

An error returned while making this request.

Value can be null.

callback.family

Family

 

The Family object.

callback.apiResponse

object

 

The resource as it exists in the API.

getMetadata([gaxOptions], callback)

Get the column family's metadata.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_get_family_meta

Parameters

Name Type Optional Description

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

metadata

object

 

The metadata.

setMetadata(metadata[, gaxOptions], callback)

Set the column family's metadata.

See Table#createFamily for a detailed explanation of the arguments.

Example

include:samples/document-snippets/family.js

region_tag:bigtable_set_family_meta

Parameters

Name Type Optional Description

metadata

object

 

Metadata object.

Values in metadata have the following properties:

Name Type Optional Description

rule

object

Yes

Garbage collection rule.

gaxOptions

object

Yes

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions.

callback

function()

 

The callback function.

Values in callback have the following properties:

Name Type Optional Description

err

error

 

An error returned while making this request.

Value can be null.

apiResponse

object

 

The full API response.

See also

Garbage Collection Proto Docs