在演示数据库中,存储了以下文档...
{
"_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"
}
现在运行以下视图,如果存在,则从文档中返回日期和标题...
function(doc) {
if(doc.date && doc.title) {
emit(doc.date, doc.title);
} }
返回空结果..
{
"total_rows": 0,
"offset": 0,
"rows": []
}
......这个结果不是预期的......