查找未在Couchdb中运行的一个查询

时间:2014-09-11 07:47:28

标签: view couchdb postman

http://127.0.0.1:5984/test/_design/test1/_view/test1/by_date?key="2009/01/30 18:04:11"  

似乎是正确但没有运行......

这是我在数据库测试中存储的文件

 {
  "_id":"biking",
  "_rev":"AE19EBC7654",
  "title":"Biking",
  "body":"My biggest hobby is mountainbiking. The other day...",
  "date":"2009/01/30 18:04:11"
 }

{
 "_id":"bought-a-cat",
 "_rev":"4A3BBEE711",
 "title":"Bought a Cat",
 "body":"I went to the the pet store earlier and brought home a little kitty...",
 "date":"2009/02/17 21:13:39"
}
{
"_id":"hello-world",
"_rev":"43FBA4E7AB",
"title":"Hello World",
"body":"Well hello and welcome to my new blog...",
"date":"2009/01/15 15:52:20"
}

我想找到单个文件(一个有自行车ID)....

1 个答案:

答案 0 :(得分:0)

如果视图的名称确实是test1/by_date,那么/可能就是问题所在。您可以尝试对其进行网址编码为%2F,以便您的查询变为:

http://127.0.0.1:5984/test/_design/test1/_view/test1%2Fby_date?key="2009/01/30 18:04:11"

但我宁愿从名称中删除斜杠。那是在惹麻烦。