Skip to content

Instantly share code, notes, and snippets.

@kilaulena
Created March 29, 2010 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kilaulena/347846 to your computer and use it in GitHub Desktop.
Save kilaulena/347846 to your computer and use it in GitHub Desktop.
db = $.couch.db("spec_db");
db.create();
db.saveDoc({'type':'battlestar', 'name':'galactica'});
db2 = $.couch.db("spec_db_2");
host = window.location.protocol + "//" + window.location.host;
$.couch.replicate(host + db.uri, host + db2.uri, {
body : {"create_target":true},
success: function(resp){
resp.ok.should.eql true
resp.history[0].docs_written.should.eql 1
},
error: function(status, error, reason){
console.log('status', status)
console.log('error', error)
console.log('reason', reason)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment