Index

Index

new Index(datastore, id)

Parameters:
Name Type Description
datastore Datastore

The parent instance of this index.

id string

The index name or id.

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

Methods

get(gaxOptionsopt, callback)

Get an index if it 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.

index Index

The Index instance.

apiResponse object

The full API response.

getMetadata(gaxOptionsopt, callback)

Get the metadata of this index.

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.