Convert QueryIndex to n1ql CREATE INDEX Query

Hi All,

I get QueryIndex by QueryIndexManager.getAllIndexes. Then I need to generate n1ql CREATE INDEX Query which shows up at the Index definition at Couchbase console web-Indexes, such as

Is there any API or common rule to convert QueryIndex to CREATE INDEX query?

Thanks for your advice in advance.


curl -s Administrator:password@ |jq '.status[].definition' | sed 's/^"//g' | sed 's/"$/;/g' | sed 's/\\"/"/g'

You could use above to get all index definitions


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.