Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.0
-
None
-
DOC-S15-May04, DOC-S16-May18, DOC-S17-Jun01, DOC-S18-Jun19, DOC-S19-Jun29, DOC-S20-Jul13[RC], DOC-S21-Jul20[Vulcan GA]
-
1
Description
the ‘%’ symbol is the escape character in URI’s. So, when using % as wild card in N1QL query, we need to escape that by replacing it with corresponding ascii code. Following works without changing the header type when I replace the n1ql wildcard ‘%' with '%25'
couchbases-MacBook-Pro-5:bin varakurprasad$ curl -v http://172.23.99.98:8093/query/service -d 'statement=SELECT meta().id FROM `travel-sample` WHERE type = "hotel" and meta().id LIKE $1 &args=["hotel_1002%25"]'
- Trying 172.23.99.98...
- TCP_NODELAY set
- Connected to 172.23.99.98 (172.23.99.98) port 8093 (#0)
> POST /query/service HTTP/1.1
> Host: 172.23.99.98:8093
> User-Agent: curl/7.51.0
> Accept: /
> Content-Length: 115
> Content-Type: application/x-www-form-urlencoded
>
- upload completely sent off: 115 out of 115 bytes
< HTTP/1.1 200 OK
< Content-Length: 416
< Content-Type: application/json; version=1.6.0
< Date: Thu, 27 Jul 2017 23:09:10 GMT
<
{
"requestID": "0107e744-1555-48d7-82ba-f76de100ba88",
"signature": {
"id": "json"
},
"results": [
{
"id": "hotel_10025"
},
{
"id": "hotel_10026"
}
],
"status": "success",
"metrics": {
"elapsedTime": "174.121649ms",
"executionTime": "173.998826ms",
"resultCount": 2,
"resultSize": 86
}
}