javascript - 在键数组中使用 startkey&endkey 时出现 CouchDB 错误

标签 javascript view couchdb

大家好,我正在尝试使用以下请求:

curl http://localhost:5984/contacts/_design/country/_view/USA?startkey=["USA",{}]&endkey=["USA",{}].

基于以下 View :

{
"_id": "_design/country",
"_rev": "1-51488ea3931fdca9b9e2de84ef99c4d9",
"language": "javascript",
"views": {
   "USA": {
       "map": "function(doc) {\nif(doc.type == \"contact\") \nemit([doc.country,doc.name] , {name: doc.name, email: doc.email});\n}\n"
   }
 }
 }

我收到此错误:[globbing] 第 72 列中的范围错误

你能帮我吗?

最佳答案

我想问题出在 cUrl 上?试试这个:

-g/--globoff
              This  option  switches  off  the "URL globbing parser". When you set this option, you can
              specify URLs that contain the letters {}[] without having them being interpreted by  curl
              itself.  Note  that  these  letters  are not normal legal URL contents but they should be
              encoded according to the URI standard.

关于javascript - 在键数组中使用 startkey&endkey 时出现 CouchDB 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38263671/

相关文章:

ios - 在收集单元格中添加背景 View

mysql - PostgreSQL 和 MySQL 权限管理等 CouchDB 数据库是否有访问控制?

go - 如何在 golang 中使用 couch db 查询限制

electron - PouchDB同步到错误的CouchDB

javascript - AngularJS 待办事项列表应用程序 - 正在添加到列表而无需输入文本

javascript - 通过一个方法调用另一个方法

python - 在 Django 中允许每个用户生成 1 个 View

javascript - AmCharts 仪表气球工具提示

javascript - 如何在jsp中创建json对象?

javascript - 用于匹配不同 URL 的正则表达式