On this page

Add index to a table

Add index to a table

Method : POST
URI : /db/<dbname>/<table_name>/index
BODY :

{
"index_name": <index_name>,
"key_type": <key_type>,
"key_size": <key size in bytes>,
"allow_duplicate": <0 or 1>
}

The body is very similar to that of create table. There are many more attributes here that we could use to set the index in a particular manner. See the details here.

Example

curl -H "Content-Type: application/json" -d '{"index_name":"org","key_type":1,"key_size":32}' -X POST http://192.168.1.105:18080/db/mydb/my_table_test/index

Response

{
"msg": "successfully created the index"
}
Was this article helpful to you? Yes No