我在 Couchbase 中有以下对象:
{
"postReplyId": "Reply_9AE1F47E585522FD1D2EFFEA7671C0855BBFDA991698B23886E37D1C65DAC8AF_1375468399745",
"userId": "User_9AE1F47E585522FD1D2EFFEA7671C0855BBFDA991698B23886E37D1C65DAC8AF",
"postId": "Message_9AE1F47E585522FD1D2EFFEA7671C0855BBFDA991698B23886E37D1C65DAC8AF_1375457606125",
"post_reply_message": "Testing",
"attachments": {
"images": [
],
"audio": [
],
"videos": [
]
},
"upVoters": [
],
"downVoters": [
],
"upVotes": 0,
"report": 0,
"reporters": [
],
"timestamp": 1375468399745,
"mtype": "reply"
}
我想查看并返回30 minutes
用户上次创建的所有帖子x
我做了:
function (doc, meta) {
if(doc.mtype == "reply") {
var dt = new Date();
if((dt.getTime() - doc.timestamp) < 1800000 )
emit(doc.userId, doc);
}
}
我将 userIds 作为 URL 中的多个键传递,但我得到旧结果
有人可以提出解决方案吗?