Class Index (8.6.0)

Package

@google-cloud/datastore

Example


const {Datastore} = require('@google-cloud/datastore');
const datastore = new Datastore();
const index = datastore.index('my-index');

Constructors

(constructor)(datastore, id)

constructor(datastore: Datastore, id: string);

Constructs a new instance of the Index class

Parameters
NameDescription
datastore Datastore
id string

Properties

datastore

datastore: Datastore;

id

id: string;

metadata

metadata?: IIndex;

Methods

get(gaxOptions)

get(gaxOptions?: CallOptions): Promise<GetIndexResponse>;

Get an index if it exists.

Parameter
NameDescription
gaxOptions CallOptions

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

Returns
TypeDescription
Promise<GetIndexResponse>

get(callback)

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

get(gaxOptions, callback)

get(gaxOptions: CallOptions, callback: GetIndexCallback): void;
Parameters
NameDescription
gaxOptions CallOptions
callback GetIndexCallback
Returns
TypeDescription
void

getMetadata(gaxOptions)

getMetadata(gaxOptions?: CallOptions): Promise<IndexGetMetadataResponse>;

Get the metadata of this index.

Parameter
NameDescription
gaxOptions CallOptions

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

Returns
TypeDescription
Promise<IndexGetMetadataResponse>

getMetadata(callback)

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

getMetadata(gaxOptions, callback)

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