Full list of strings that are reserved / keywords/ inbuilt functions / etc

This list is of “reserved words”: https://docs.couchbase.com/server/5.5/n1ql/n1ql-language-reference/reservedwords.html

But missing from this list are other “words” that are “reserved” by N1QL in the sense that they cannot be used as field names in queries without being escaped. For example MIN, MAX, and HASH.

Is there a complete list somewhere? I’d prefer not to escape field names in my queries because in Go ` is the terminator for raw strings and that makes escaping n1ql fields really awkward (i.e. I can’t figure out how to do it and maintain readability of the queries).


insert into default values ("k01",{"min":1});
select min from default USE KEYS "k01";
            "min": 1

Aggregates and functions can be used as fields. As these needs to be functionaname( optional arguments)

If I do this:

SELECT hash FROM testbucket

I get this:

[3000] syntax error - at hash

There is DOC-3187 is present to update the documentation.

HASH is not function it is keyword. MIN(), MAX(), … other N1QL functions not reserved keywords. You can use as fields.