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.
Jin.

@jinchong,

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

You could use above to get all index definitions

2 Likes

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