Strange behavior when adding twho or more fields via ||

most functions return type might documented.
If function expects certain type of arguments, passed wrong once result will be NULL.

https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/stringfun.html#fn-str-concat