const client = new Search();
const index = client.index("movies");

const infoResponse = await index.info();
/*
{ 
  documentCount: 100,
  pendingDocumentCount: 5,
}
*/

When it comes to info requests, there are two alternatives. One for index level and one for database level.

Index Info

Used to retrieve the stats of an index.

Response

documentCount
number
required

The total number of documents in the database, that are ready to use.

pendingDocumentCount
number
required

The number of documents in the database, that are still processing and not ready to use.

Database Info

Alternatively, you can call info on the client itself, which will return information about the whole database:

Response

documentCount
number
required

The total number of documents in the database, that are ready to use.

pendingDocumentCount
number
required

The number of documents in the database, that is still processing and not ready to use.

diskSize
number
required

The size of the database, in b.

indexes
Record<string, Object>
required

A map of indexes to their information in the following format

const client = new Search();
const index = client.index("movies");

const infoResponse = await index.info();
/*
{ 
  documentCount: 100,
  pendingDocumentCount: 5,
}
*/