Reputation: 11
I tried using N1QL Query as a REST API
endpoint to access the data but was getting a 404 error. Is there anything that needs to be configured in couchbase server to support N1Q1 Rest API
?
Upvotes: 1
Views: 432
Reputation: 7414
The bucket name `travel-sample` has special characters so you need to use escaped identifier (back ticks).
Query service is running on 8093 port Also you must send REST API to 8093 port.
You can also try this.
curl -v http://localhost:8093/query/service -H "Content-Type: application/json" -d '{"statement":"select a.name,r.destinationairport,count(a.name) AS total_flights from `travel-sample` r join `travel-sample` a on keys r.airlineid where r.type = "route" and a.type="airline" group by r.destinationairport, a.name order by r.destinationairport", "creds":[{"user":"user","pass":"xxxx"}]}'
Upvotes: 1