1
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 的文档)....

4

1 回答 1

0

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

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

但我宁愿从名称中删除斜线。那是自找麻烦。

于 2014-09-13T01:30:22.140 回答