How to stop sync_gateway from syncing old documents?

Technology Used:

  • sync_gateway : 1.4.1
  • Couchbase Server : 4.5

I have a workaround where need to stop syncing specific documents from re-sync if that is one week older. I have added the code for sync_gateway sync that it won’t give channels to that type of documents during syncing.

After this restart the sync_gateway and re-sync the use on mobile. As a result the document with the last revision in which user’s channel exist came back to device.

Please help me in finding a way to stop syncing old documents.
Thanks in advance.

Is there any other way to do this without filtered pull replications?

FYI

https://groups.google.com/forum/#!msg/mobile-couchbase/0XKPMADsa0U/U5BxKDDm8l4J