Family

Family

Create a Family object to interact with your table column families.

Constructor

new Family(table, id)

Parameters:
Name Type Description
table Table
id string
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');
```

Methods

create(optionsopt, callback)

Create a column family.

Parameters:
Name Type Attributes Description
options object <optional>

See Table#createFamily.

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

family Family

The metadata.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_create_family

delete(gaxOptionsopt, callbackopt)

Delete the column family.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

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

callback function <optional>

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_del_family

exists(gaxOptionsopt, callback)

Check if the column family exists.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

exists boolean

Whether the family exists or not.

Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_exists_family

get(optionsopt)

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.

Parameters:
Name Type Attributes Description
options object <optional>

Configuration object.

Properties
Name Type Attributes Default Description
autoCreate boolean <optional>
false

Automatically create the instance if it does not already exist.

gaxOptions object <optional>

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

callback.error error <nullable>

An error returned while making this request.

callback.family Family

The Family object.

callback.apiResponse object

The resource as it exists in the API.

Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_get_family

getMetadata(gaxOptionsopt, callback)

Get the column family's metadata.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

metadata object

The metadata.

Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_get_family_meta

setMetadata(metadata, gaxOptionsopt, callback)

Set the column family's metadata.

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

Parameters:
Name Type Attributes Description
metadata object

Metadata object.

Properties
Name Type Attributes Description
rule object <optional>

Garbage collection rule.

gaxOptions object <optional>

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

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

See:
Example

include:samples/api-reference-doc-snippets/family.js

region_tag:bigtable_api_set_family_meta