N1ql Nodejs SDK Like Operator Placeholder

I am using nodejs N1ql SDK to perform queries. I want to use LIKE operator in my query. Here is the syntax: var queryString = “SELECT * from bucket_name WHERE companyId = $1 AND type = $2 AND checkIn BETWEEN $3 AND $4 AND Name LIKE $5 + ‘%’ AND ORDER BY checkIn DESC”

But I am getting error “syntax error - at ORDER”. Problem is that I am unsure how to use a placeholder for the LIKE operator.
term is a string here.

Thanks in advance

The issue might be at the LIKE $5 + ‘%’ … can you try: LIKE CONCAT($5, “%”)

1 Like

This is not valid syntax. remove AND before ORDER. Also follow @davids suggestion or include % inside $5

1 Like