Confirming document upload in couchbase

Hello everyone,

I am creating an app that logs data (using couchbase mobile). I am creating documents that have the data and sending those documents to a couchbase server. Or I am trying to anyways. One major concern I have is how do I confirm a document is stored on the server so that it can be immediately deleted on the device? I am hoping there is a quick and efficient way to do this. The end result is to have a thread constantly checking if there is a connection to couchbase, and if so start sending data up to clear it off the device. Most documentation seems to be regarding syncying the database, however I don’t want to do this because I don’t want to keep a copy of the data on the device. It would take up too much storage. Thanks for any help.

It sounds like you’re, effectively, trying to re-implement the replicator. It is indeed difficult to,manage connectivity and keep,track of which docs have been uploaded. Let us take care of that.

You can run a push replication, and when notified that a document has been pushed, purge that document. This will ensure your local database doesn’t grow.

(Now I can’t remember whether per-document replicator notifications are in 2.1 or not … if not, they’ll be in 2.5, which is going through final testing and will be released Very Soon Now.)