API Design Issue

I am using PouchDB with Sync Gateway. I make an entry, the sync is happening in the background and time of the sync in unknown, therefore the api need to raise events when sync is complete. This is how firebase does it, but in firebase the developer has fine grained control over each entry with events. But this is not the case here?

There are replication events that can be used to determine when all the documents that should be pushed have been pushed (for example changed, paused, active…). See all events here http://pouchdb.com/api.html#replication.


As per documentation, “change” event in replication that was started with live mode acts as a completed sync cycle because if fetches all the yet synced documents.


Thanks for the reply James. I had already reviewed the reference you sent. The main issue is that the developers do not have control over which data is being replicated and in what sequence. What is required is that the developer has exact control on the data being asked for etc.

So you’re looking for a way to know when a given document has been pushed to sync gateway?

Yes something like that.

I know there is a new method called pendingDocuments in 1.2 to know which documents haven’t been pushed yet. But I don’t know of an equivalent in PouchDB. Might be worthwhile to ping @nolanlawson on twitter.