Hello. I’m wondering if there is an easy way to create an index from the JSON output generated by the following query:
SELECT * FROM system:indexes
The format of the JSON is
[
{
"indexes": {
"condition": "(`type` = \"TheType\")",
"datastore_id": "http://127.0.0.1:8091",
"id": "f27386d2fc35f6a2",
"index_key": [
"`owner`",
"`startDate`",
"`createdAt`"
],
"keyspace_id": "test",
"name": "idx_TheType_StartDate",
"namespace_id": "default",
"state": "online",
"using": "gsi"
}
}
]
Is there a N1QL query to create an index based on the JSON output above? Or do I need to parse the JSON and generate the CREATE INDEX
query string?