Hello, I am tasked with writting a query that has to run with values comming from a UI request, hence some of the values may no be present. Normally in SQL databases this can be achieved using COALESCE and ISNULL etc, how can I achieve the same using N1QL?
FROM bucket1 g LEFT JOIN bucket1 tick ON KEYS tick.tickDocId
WHERE g.metaData.refType = “c”
AND UPPER(g.g.firstName)= “JOHN”
ORDER BY UPPER(g.lastName) ASC
LIMIT 10 OFFSET 0
I would like to pass any of the values on the where clause as values that could be missing and hence ommited from the final execution of the query, similar to SQL COALESCE.
I have come across the functions covered here: https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/condfununknown.html
However there wasn’t a single example there illustrating the usage of these functions.