couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Adding vs replicating documents
Date Fri, 08 Jun 2012 15:58:15 GMT

On Jun 7, 2012, at 8:12 PM, Luca Matteis wrote:

> Ok basically I have a program that runs on my local computer that
> generates data that I want to insert/modify to my Couch instance. So
> my local data should be in synch with my cloud data... but i can't
> install CouchDB locally... so how do I keep it in synch with my hosted
> Couch instance without having to re-upload all of my data every time?

For each record in the local file, decide whether it's different from what's in CouchDB. If
it is, PUT the document to the database.

How to tell whether it's different depends on what's in your file. If you have timestamps
it's pretty easy. Otherwise you may have to do something like storing a local side file with
checksums of every document, and then comparing the values in the file against the saved checksums.
The checksum file can also store the rev ID from the last time you saved to CouchDB, which
will make saving easier.

View raw message