Get Indexes Operation


  • Use GetIndexesOperation to retrieve multiple index definitions from the database.

  • The operation will execute on the node defined by the client configuration.
    However, the index definitions returned are taken from the database record,
    which is common to all the database-group nodes.
    i.e., an index state change done only on a local node is not reflected.

  • To get a specific index state on a local node use GetIndexStatisticsOperation.

  • In this page:


Get indexes example

// Define the get indexes operation
// Pass number of indexes to skip & number of indexes to retrieve
const getIndexesOp = new GetIndexesOperation(0, 10);

// Execute the operation by passing it to maintenance.send
const indexes = await store.maintenance.send(getIndexesOp);

// indexes will contain the first 10 indexes, alphabetically ordered by index name
// Access an index definition from the resulting list:
const name = indexes[0].name;
const state = indexes[0].state;
const lockMode = indexes[0].lockMode;
const deploymentMode = indexes[0].deploymentMode;
// etc.

Syntax

const getIndexesOp = new GetIndexesOperation(start, pageSize);
Parameters Type Description
start number Number of indexes to skip
pageSize number Number of indexes to retrieve
Return value of store.maintenance.send(getIndexesOp)
IndexDefinition[] A list of IndexDefinition,
ordered alphabetically by index name.