The "listIndexes" action lists indexes in the specified database table that the logged-in user is allowed to see. It retrieves all indexes associated with a specific table.
Request examples
Minimal
{
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"tableName": "athlete"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "db",
"apiVersion": "1.0",
"requestId": "2",
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"ownerName": "admin",
"tableName": "athlete",
"skipRecords": 0,
"maxRecords": 20
},
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Minimal
{
"result": {
"data": [
{
"collectStats": false,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "id",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "id_pk",
"indexNumber": 0,
"ownerName": "admin",
"tableName": "athlete",
"unique": true
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "ranking",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "ranking",
"indexNumber": 1,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "earnings",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "earnings",
"indexNumber": 2,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "on",
"conditionalExpression": "livedpast2000 == 1",
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": true,
"name": "name",
"reverseCompare": true,
"sortDescending": true
}
],
"filename": ".\\ctreeSQL.dbs\\admin_athlete_name_livedpast2000.idx",
"immutableKeys": false,
"indexName": "name_livedpast2000",
"indexNumber": 3,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
}
]
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"result": {
"primaryIndexName": "name",
"data": [
{
"collectStats": false,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "id",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "id_pk",
"isPrimaryIndex": true,
"indexNumber": 0,
"ownerName": "admin",
"tableName": "athlete",
"unique": true
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "ranking",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "ranking",
"indexNumber": 1,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "off",
"conditionalExpression": null,
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": false,
"name": "earnings",
"reverseCompare": false,
"sortDescending": false
}
],
"filename": "admin_athlete.idx",
"immutableKeys": false,
"indexName": "earnings",
"indexNumber": 2,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
},
{
"collectStats": true,
"compression": "on",
"conditionalExpression": "livedpast2000 == 1",
"databaseName": "ctreeSQL",
"deferIndexing": false,
"fields": [
{
"caseInsensitive": true,
"name": "name",
"reverseCompare": true,
"sortDescending": true
}
],
"filename": ".\\ctreeSQL.dbs\\admin_athlete_name_livedpast2000.idx",
"immutableKeys": false,
"indexName": "name_livedpast2000",
"indexNumber": 3,
"ownerName": "admin",
"tableName": "athlete",
"unique": false
}
]
},
"requestId": "2",
"debugInfo": {
"request": {
"api": "db",
"action": "listIndexes",
"params": {
"databaseName": "ctreeSQL",
"ownerName": "admin",
"tableName": "athlete",
"skipRecords": 0,
"maxRecords": 20
},
"apiVersion": "1.0",
"requestId": "2",
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
},
"serverSuppliedValues": {
"databaseName": "ctreeSQL",
"ownerName": "admin"
},
"errorData": {
"errorData": null
},
"warnings": []
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
databaseName |
The You specify this property when you want to use a different database instead of the default. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
ownerName |
The You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code. It is an error to set If no default owner is specified during |
Optional with default of the session's "defaultOwnerName" property |
string | 1 to 64 bytes |
tableName |
The See table name in System specifications for the table naming requirements and limitations.
"params": {
"tableName": "ctreeTable"
} |
Required - No default value | string | 1 to 64 bytes |
skipRecords |
The "skipRecords" property specifies the number of records to skip over when paginating the results. It is used with "maxRecords" to paginate the results. If the value is not null or omitted, the server returns results from the beginning. If it is > 0, the server skips over the specified number of records and returns results starting from that point up until it returns the maximum number of results as defined by "maxRecords". |
Optional with default of 0
|
integer |
0 to 9223372036854775807
|
maxRecords |
The "maxRecords" property specifies the maximum number of records to be returned. It is used with "skipRecords" to paginate the results. If the value is not null or omitted, the server returns the maximum number of results specified by "maxRecords". |
Optional with default of 20 |
integer |
-1 to 65535
|
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
primaryIndexName |
The “primaryIndexName” property returns the name of the primary key index. If there is none, it returns “”.
|
string | 0 to 256 bytes |
data |
The |
array of objects | The action determines its contents. |
|
data .collectStats |
The “collectStats” property identifies whether usage statistics are being collected and stored. |
boolean |
|
|
data .compression |
The “compression” property identifies whether the index is compressed. |
string |
|
|
data .conditionalExpression |
The “conditionalExpression” property identifies an optional conditional expression that filters which records are included in the index. It is null when there is no conditional expression. |
string |
null or a string containing a conditional expression. |
|
data .databaseName |
The
|
string | 1 to 64 bytes |
|
data .deferIndexing |
“deferindexing” identifies whether deferred indexing is enabled. A deferred index builds and updates asynchronously. This speeds up inserts, updates, and deletes, with a slight delay due to the changes being included in the index. |
boolean |
|
|
data .fields |
The
"fields": [
{
"autoValue": "none",
"name": "name",
"type": "varchar",
"length": 50,
"scale": null,
"defaultValue": null,
"nullable": false, |
array |
updateRecords and deleteRecords only:
|
|
data .fields .caseInsensitive |
The When "fields": [
{
"caseInsensitive": true
}
] |
Boolean |
|
|
data .fields .name |
The The The
|
string | 1 to 64 bytes |
|
data .fields .reverseCompare |
The When "fields": [
{
"reverseCompare": true
}
] |
Boolean |
|
|
data .fields .sortDescending |
The "fields": [
{
"sortDescending": true
}
] |
Optional with default of false
|
Boolean |
|
data .filename |
The
|
string | 0 to 2048 bytes |
|
data .immutableKeys |
"immutableKeys" indicates whether a key's value can be changed. |
boolean |
|
|
data .indexName |
The "params": {
"indexName": "index1"
} |
Required - No default value |
string |
|
data .ownerName |
The "ownerName" property identifies the user who owns an object (see Object owner). |
string | 0 to 64 bytes |
|
data .tableName |
The See table name in System specifications for the table naming requirements and limitations. |
string | 1 to 64 bytes |
|
data .unique |
The "unique" property causes the "createIndex" action to create a unique index, which requires the columns in the index to have a unique value for each record in the table, when set to true. |
Boolean |
|