开发者

CouchDB: query for "documents tagged with A or B"?

Short of doing client-side filtering or POSTing a one-off map/reduce (which would result in a table scan), is there any way to query for documents tagge开发者_开发技巧d with tagA or tagB?


issue a POST request with a body of {"keys":["tagA","tagB"],"include_docs":true} to a view with a map of function(doc){doc.tags.forEach(function(tag){emit(tag,1)})}

that should do yah :)

from query options section in http://wiki.apache.org/couchdb/HTTP_view_API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜