Skip to content

Get indexes api

  • List the indexes of a table with the get-indexes system API, in the same format for every database. From custom code, use g.sys.system.getIndexes.

Request Method: POST

URL

/api/system-api/user-path/get-indexes

Request payload

  • One table, or a list of tables (then the response is a list of lists, in the same order).
{
    "instance": "mysql8",
    "database": "inventory",
    "table": "orders"
}

Response

{
    "success": true,
    "statusCode": 200,
    "data": [
        { "name": "PRIMARY", "key": { "id": 1 }, "unique": true },
        { "name": "am_ix_orders_customer_id_status_3f9a1c", "key": { "customer_id": 1, "status": -1 }, "unique": false, "method": "BTREE" }
    ],
    "errors": []
}
Property Meaning
name Index name.
key The fields in order, with their direction : 1 ascending, -1 descending, hashed or text on MongoDB.
unique A unique index (the primary key included).
method The access method when the database tells it (BTREE, HASH, gin...).