这是我的看法:
function(doc) {
if(doc.type=="mail" && doc.user_id == 116 && doc.fid == 81 ){
emit([doc.time], doc.msg);
}
}
我默认存储 JS Date() ,这是按降序排序的文档列表。
"Wed May 09 2012 00:16:02 GMT+0800 (SGT)"
"Wed May 09 2012 00:10:45 GMT+0800 (SGT)"
"Wed May 02 2012 00:59:47 GMT+0800 (SGT)"
"Tue May 08 2012 23:55:54 GMT+0800 (SGT)"
"Tue May 08 2012 21:59:42 GMT+0800 (SGT)"
"Tue May 01 2012 23:11:57 GMT+0800 (SGT)"
"Tue May 01 2012 19:00:37 GMT+0800 (SGT)"
"Tue May 01 2012 18:59:55 GMT+0800 (SGT)"
**"Sun May 13 2012 16:02:58 GMT+0800 (SGT)"**
"Sun May 13 2012 16:01:16 GMT+0800 (SGT)"
如您所见,日期未正确排序并且"Sun May 13 2012 16:02:58 GMT+0800 (SGT)"
是最后一个条目。我该如何解决?谢谢!