On Tue, May 20, 2014 at 12:29 PM, Brian Hardy <[email protected]> wrote:
We have and android application which mostly pulls data but can push a
> small amount too.
> I have one sync gateway url and I create replications for push and for
> pull. I have not done anything to indicate what data is for pull and which
> is for push. Is there way to do that?
>
Yes, you can filter on both the push and the pull side.
For the push side, you can call:
database.setFilter("myPushFIlter", new ReplicationFilter() {
@Override
public boolean filter(SavedRevision revision, Map<String,
Object> params) {
// .. decide if you want that document pushed or not
}
});
For the pull side, you can use Sync Gateway "channels". See the Sync
Gateway Guide <http://docs.couchbase.com/sync-gateway/> for more info.
>
> I've tried to clear out some old unwanted data from our couchbase server.
> Afterwards unfortunately, when the client stars up and connects again it
> syncs all the old unwanted data back to my couchbase server.
>
Yep, that's the expected behavior. You should delete the data via the Sync
Gateway REST API instead.
> When our application is installed and then starts up for the first time,
> It takes a long time syncing data. There are about 1800 items in our
> couchbase server. Why does it take so long for data to get synced on
> application load after application install? What are some ways I can
> alleviate this?
>
As a first step, I would look into filtering the pull via channels.
Which version of Couchbase Lite are you using? We've been actively working
to improve the replication performance -- for example we just recently
added the ability to use the _bulk_get sync gateway endpoint, which has the
effect of batching several requests into a single request.
--
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/CACSSHCGfCnLai-Zkae1dYoK-9%2BLFSpQo-9BF7qZF1C4K63pxxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.