@textile/hub > Client > getCollectionIndexes
Client.getCollectionIndexes() method
Returns an existing indexes for a collection.
Signature:
getCollectionIndexes(threadID: ThreadID, name: string): Promise<pb.Index.AsObject[]>;
Parameters
Parameter | Type | Description |
---|---|---|
threadID | ThreadID | the ID of the database. |
name | string | The human-readable name for the collection. |
Returns:
Promise<pb.Index.AsObject[]>
Example
Return a set of indexes for our astronauts collection
import {Client, ThreadID} from '@textile/hub'
async function getIndexes (client: Client, threadID: ThreadID) {
return await client.getCollectionIndexes(threadID, 'astronauts')
}