首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >N1QL Rest API返回404

N1QL Rest API返回404
EN

Stack Overflow用户
提问于 2019-10-16 21:31:00
回答 1查看 87关注 0票数 1

我尝试使用N1QL查询作为REST API端点来访问数据,但是得到了一个404错误。需要在couchbase服务器中配置什么才能支持N1Q1 Rest API

http://127.0.0.1:8091/query/service?statement=select%20a.name,r.destinationairport,%20count(a.name)%20total_flights%20from%20travel-sample%20r%20join%20travel-sample%20a%20on%20keys%20r.airlineid%20where%20r.type%20=%22route%22%20and%20a.type=%22airline%22%20group%20by%20r.destinationairport,%20a.name%20order%20by%20r.destinationairport

EN

回答 1

Stack Overflow用户

发布于 2019-10-17 00:15:04

代码语言:javascript
复制
The bucket name `travel-sample` has special characters so you need to use escaped identifier (back ticks).

查询服务正在8093端口上运行,您还必须将REST API发送到8093端口。

你也可以试试这个。

代码语言:javascript
复制
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"}]}'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58414582

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档