In CB Server 7, I can find no way to use the IF EXISTS clause when dropping an index without a syntax error:
DROP INDEX idx1 IF EXISTS ON bucket - fails DROP INDEX IF EXISTS idx1 ON bucket - fails DROP INDEX idx1 ON bucket IF EXISTS - fails DROP INDEX(idx1) IF EXISTS ON bucket - fails DROP INDEX 'idx1' IF EXISTS ON bucket - fails DROP INDEX('idx1') IF EXISTS ON bucket - fails
Do you mean that the IF EXISTS syntax for DROP INDEX wasn’t added until 7.1? If so, it would be useful to see that noted in the N1QL Query Language Reference documentation for DROP INDEX.
current in URL is current release 7.1
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/dropindex.html
7.0 (replace current 7.0)
https://docs.couchbase.com/server/7.0/n1ql/n1ql-language-reference/dropindex.html