title: Filtering posts by timestamp and userId
body: <p>I have the following object in Couchbase:</p>
  
  <pre><code>{
     "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"
  }
  </code></pre>
  
  <p>I would like to have a view and return all the posts created during the last <code>30 minutes</code> by the user <code>x</code></p>
  
  <p>I did:</p>
  
  <pre><code>function (doc, meta) {
    if(doc.mtype == "reply") {
      var dt = new Date();
      if((dt.getTime() - doc.timestamp) &lt; 1800000 )
      emit(doc.userId, doc);
    }
  }
  </code></pre>
  
  <p>and i pass the userIds as multiple keys in the URL, but I get old results</p>
  
  <p>Can someone suggest a solution?</p>