title: pouchDB filtering replication based on logic
body: <p>I am trying to figure out how the filter works.</p>
  
  <p>My goal is to exclude documents with a <code>type</code> of <strong>user_submits</strong> and only grab the documents with <code>type</code> <strong>form</strong> that was created less than a month ago.</p>
  
  <p>Am I doing this right? Do I just return <code>doc</code> if all my needs are met?</p>
  
  <pre><code>local_db.replicate.from(remote_db, {
    filter: function (doc) {
        if(doc.type == 'form')
          if(doc.created &gt;= (Math.floor(Date.now() / 1000)-2419200))
            return doc;
        else if(doc.type !== 'user_submits') return doc;
    }
  }).on('complete', function () {
    console.log("success");
  })
  .on('error', function (err) {
    console.log("error");
  });
  </code></pre>
  
  <p>I only ask this because the only example I see for filtering is something like the following and I'm confused on the logic behind it.</p>
  
  <pre><code>filter: function (doc) {
    return doc.type === 'marsupial';
  }
  </code></pre>