indexingcouchbasesql++

How to create an index for fields which can be missing at Couchbase 7.1


I'm trying to create an index for fields which can be missing at Couchbase 7.1

Even if I use an example from the Couchbase documentation, I have a syntax error: INCLUDE (reserved word)

CREATE INDEX idx_airport_include
ON `travel-sample`.inventory.airport(district INCLUDE MISSING, name);

I tried to enclose the reserved words inside backticks, but without success:

`INCLUDE` `MISSING`, `INCLUDE MISSING`

Any ideas how to create that kind of index ?


Solution

  • As Mathew Groves mentioned INCLUDE MISSING attribute is only available in 7.1.2 or later versions

    https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/createindex.html#include-missing