> On Apr 20, 2015, at 10:09 AM, Victor Fernandez <[email protected]> 
> wrote:
> 
> I understand I can do a purgeDocument on the mobile app to discard any 
> unwanted old document, but what I want to do is to avoid the sync gateway 
> process to download data older than, let's say 7 days. Is it possible to set 
> a filter on sync gateway configuration to do this? If so, how?

You could run a server-side process to purge documents older than 7 days, if 
you don’t want to keep them on the server.

If you want them on the server but just don’t want your client to pull them, 
it’s a little tricky since you can’t assign docs to channels by relative dates 
(a doc only gets assigned to channels when it's updated, when its age is by 
definition zero.) The advice I give is to define per-week channel names (like 
“2015-01” for the first week in 2015) and have the sync function assign a doc 
to one such channel based on a timestamp property in it. The client then comes 
up with the channel name for the current week and explicitly pulls that channel.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/3DD11015-6A9F-44B7-8899-54E995C4E7E3%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to