我的存储桶中有文件:
{ type: "post", author: "1", subject: "s1", timestamp: 11}
{ type: "post", author: "1", subject: "s2", timestamp: 12}
{ type: "post", author: "2", subject: "s3", timestamp: 9 }
{ type: "post", author: "3", subject: "s4", timestamp: 10}
{ type: "post", author: "4", subject: "s5", timestamp: 14}
{ type: "post", author: "5", subject: "s6", timestamp: 11}
我有观点:
function(doc, meta) {
if(doc.t === 'post') {
emit([doc.timestamp, doc.author]);
}
}
它给了我:
[11, "1"]
[12, "1"]
[9, "2"]
[10, "3"]
[14, "4"]
[11, "5"]
我想选择按时间戳排序的特定用户 ["2","3","5"] 的帖子。我的意思是“获取一些用户的最新帖子”。有可能吗?