Class Family (3.10.0)

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

Package

@google-cloud/bigtable

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');

Constructors

(constructor)(table, id)

constructor(table: Table, id: string);

Constructs a new instance of the Family class

Parameters
NameDescription
table Table
id string

Properties

bigtable

bigtable: Bigtable;

id

id: string;

metadata

metadata?: IColumnFamily;

name

name: string;

table

table: Table;

Methods

create(options)

create(options?: CreateFamilyOptions): Promise<CreateFamilyResponse>;
Parameter
NameDescription
options CreateFamilyOptions
Returns
TypeDescription
Promise<CreateFamilyResponse>

create(options, callback)

create(options: CreateFamilyOptions, callback: CreateFamilyCallback): void;
Parameters
NameDescription
options CreateFamilyOptions
callback CreateFamilyCallback
Returns
TypeDescription
void

create(callback)

create(callback: CreateFamilyCallback): void;
Parameter
NameDescription
callback CreateFamilyCallback
Returns
TypeDescription
void

delete(gaxOptions)

delete(gaxOptions?: CallOptions): Promise<DeleteFamilyResponse>;
Parameter
NameDescription
gaxOptions CallOptions
Returns
TypeDescription
Promise<DeleteFamilyResponse>

delete(gaxOptions, callback)

delete(gaxOptions: CallOptions, callback: DeleteFamilyCallback): void;
Parameters
NameDescription
gaxOptions CallOptions
callback DeleteFamilyCallback
Returns
TypeDescription
void

delete(callback)

delete(callback: DeleteFamilyCallback): void;
Parameter
NameDescription
callback DeleteFamilyCallback
Returns
TypeDescription
void

exists(gaxOptions)

exists(gaxOptions?: CallOptions): Promise<FamilyExistsResponse>;
Parameter
NameDescription
gaxOptions CallOptions
Returns
TypeDescription
Promise<FamilyExistsResponse>

exists(gaxOptions, callback)

exists(gaxOptions: CallOptions, callback: FamilyExistsCallback): void;
Parameters
NameDescription
gaxOptions CallOptions
callback FamilyExistsCallback
Returns
TypeDescription
void

exists(callback)

exists(callback: FamilyExistsCallback): void;
Parameter
NameDescription
callback FamilyExistsCallback
Returns
TypeDescription
void

formatRule_(ruleObj)

static formatRule_(ruleObj: GcRule): IGcRule;

Formats Garbage Collection rule into proto format.

Parameter
NameDescription
ruleObj GcRule

The rule object.

Returns
TypeDescription
IGcRule

{object}

Example

Family.formatRule({
  age: {
    seconds: 10000,
    nanos: 10000
  },
  versions: 2,
  union: true
});
// {
//   union: {
//     rules: [
//       {
//         maxAge: {
//           seconds: 10000,
//           nanos: 10000
//         }
//       }, {
//         maxNumVersions: 2
//       }
//     ]
//   }
// }

get(options)

get(options?: GetFamilyOptions): Promise<GetFamilyResponse>;
Parameter
NameDescription
options GetFamilyOptions
Returns
TypeDescription
Promise<GetFamilyResponse>

get(options, callback)

get(options: GetFamilyOptions, callback: GetFamilyCallback): void;
Parameters
NameDescription
options GetFamilyOptions
callback GetFamilyCallback
Returns
TypeDescription
void

get(callback)

get(callback: GetFamilyCallback): void;
Parameter
NameDescription
callback GetFamilyCallback
Returns
TypeDescription
void

getMetadata(gaxOptions)

getMetadata(gaxOptions?: CallOptions): Promise<GetFamilyMetadataResponse>;
Parameter
NameDescription
gaxOptions CallOptions
Returns
TypeDescription
Promise<GetFamilyMetadataResponse>

getMetadata(gaxOptions, callback)

getMetadata(gaxOptions: CallOptions, callback: GetFamilyMetadataCallback): void;
Parameters
NameDescription
gaxOptions CallOptions
callback GetFamilyMetadataCallback
Returns
TypeDescription
void

getMetadata(callback)

getMetadata(callback: GetFamilyMetadataCallback): void;
Parameter
NameDescription
callback GetFamilyMetadataCallback
Returns
TypeDescription
void

setMetadata(metadata, gaxOptions)

setMetadata(metadata: SetFamilyMetadataOptions, gaxOptions?: CallOptions): Promise<SetFamilyMetadataResponse>;
Parameters
NameDescription
metadata SetFamilyMetadataOptions
gaxOptions CallOptions
Returns
TypeDescription
Promise<SetFamilyMetadataResponse>

setMetadata(metadata, gaxOptions, callback)

setMetadata(metadata: SetFamilyMetadataOptions, gaxOptions: CallOptions, callback: SetFamilyMetadataCallback): void;
Parameters
NameDescription
metadata SetFamilyMetadataOptions
gaxOptions CallOptions
callback SetFamilyMetadataCallback
Returns
TypeDescription
void

setMetadata(metadata, callback)

setMetadata(metadata: SetFamilyMetadataOptions, callback: SetFamilyMetadataCallback): void;
Parameters
NameDescription
metadata SetFamilyMetadataOptions
callback SetFamilyMetadataCallback
Returns
TypeDescription
void