Add the ability to replicate data with a CouchDB server. Here is the (semi-
pseudo) code that Jan from CouchDB gave me on how to do it:
// replicate from couchdb
var persevere = new Persevere("foo");
var couchdb = new CouchDB("foo");
var docs_by_seq = couchdb.view("_all_docs_by_seq", {startkey: 0});
var last_seq = docs_by_seq.seq_nr;
var new_docs.rows;
for(var idx in new_docs) {
var id = new_docs[idx].id;
var doc = couchdb.open(id); // hidden GET request
if(doc._deleted) {
persevere.delete(doc);
} else {
persevere.save(doc);
}
}
Original issue reported on code.google.com by kris...@gmail.com on 29 Apr 2009 at 4:53
Original issue reported on code.google.com by
kris...@gmail.com
on 29 Apr 2009 at 4:53