This query is good when used in the dashboard
UPDATE staging SET TAKE_PHOTO = ifmissing(TAKE_PHOTO, 0) + 1 WHERE meta().id=‘57b71ba5-5f57-4692-880c-5eaff7bb7fde’
but when i use it on N1ql statement service it returns “syntax error - at 1”
http://myserver/query/service?statement=UPDATE staging SET TAKE_PHOTO = ifmissing(TAKE_PHOTO, 0) + 1 WHERE meta().id=‘57b71ba5-5f57-4692-880c-5eaff7bb7fde’
vsr1
June 9, 2021, 3:58am
2
curl -v http://localhost:8093/query/service -H "Content-Type: application/json" -d '{"statement": "UPDATE staging AS USE KEYS \"57b71ba5-5f57-4692-880c-5eaff7bb7fde\" SET TAKE_PHOTO = ifmissing(TAKE_PHOTO, 0) + 1"}'
https://docs.couchbase.com/server/current/n1ql/n1ql-rest-api/index.html
is URI character , If you are not using Json content type replace + with %2B
Percent-encoding, also known as URL encoding, is a method to encode arbitrary data in a Uniform Resource Identifier (URI) using only the limited US-ASCII characters legal within a URI. Although it is known as URL encoding, it is also used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN). As such, it is also used in the preparation of data of the /x-www-form-urlencoded media type, as is often us...
thank you i solved the problem via URL encoding it. It is the same as your answer thanks