Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Replication

nutrixtech edited this page May 26, 2012 · 1 revision

Replication is one of the strong points of CouchDB, and TouchDB has been made to replicate successfully with Apache CouchDB (at the moment).

  • As shown in Getting Started page, successfully instantiate a CouchDbInstance object

      CouchDbInstance dbInstance;
    
  • The simple way of executing a

      String DATABASE_NAME="
      /*code to instantiate dbInstance*/
      ReplicationCommand replicationCommand;
      replicationCommand = new ReplicationCommand.Builder()
      		.source(DATABASE_NAME)
      		.target("http://<username>:<password>@remotehostaddress:5984/databasename")
      		.continuous(true)
      		.build();
      dbInstance.replicate(replicationCommand);
    

note: The builder has some more working functions like filter(), and queryParams()

This would send a request to replicate from the SOURCE to TARGET with the given conditions.