title: Couchbase view documents older than one month
body: <p>I am trying to create a couchbase view which retrieve the IDs of all the views that haven't been updated for more than one month.
  They also should not have the string ID in their key:</p>
  
  <pre><code>function (doc, meta) {
  
    if (meta.id.indexOf("ID") == -1) {
      var currentDate = new Date();
      var currentDateInMillis = currentDate.getTime();
      if (doc.lastTimestampMillis != null &amp;&amp; doc.lastTimestampMillis &lt; (currentDateInMillis - (30 * 24 * 60 * 60 * 1000))) {
        emit(meta.id, meta.id)
      }
    }
  }
  </code></pre>
  
  <p>Notice that I have lastTimestampMillis field in my document.</p>
  
  <p>Well, This code doesn't work.</p>