@@ -864,41 +864,49 @@ function sync(doc, oldDoc) {
864864
865865
866866// tag::icr-repl-create-pull-oneshot[]
867- //. . . other configuration entries
868- "db1-rep-id3-pull-oneshot" :
867+ {
868+ // . . . other configuration entries
869+ "db1-rep-id3-pull-oneshot" : {
869870// tag::icr-repl-create-pull-oneshot-body[]
870- "replication_id" : " db1-rep-id3-pull-oneshot" , // <.>
871- "direction" : " pull" ,
872- "remote" : " http://user1:password@example.com:4985/db1-remote" , // <.>
873- "filter" : " sync_gateway/bychannel" ,
874- "query_params" : { "channels" : [" channel1.user1" ] }
871+ "replication_id" : " db1-rep-id3-pull-oneshot" , // <.>
872+ "direction" : " pull" ,
873+ "remote" : " http://user1:password@example.com:4985/db1-remote" , // <.>
874+ "filter" : " sync_gateway/bychannel" ,
875+ "query_params" : {
876+ "channels" : [" channel1.user1" ]
877+ }
875878// end::icr-repl-create-pull-oneshot-body[]
879+ }
876880// . . . other configuration entries
881+ }
877882// end::icr-repl-create-pull-oneshot[]
878883
879884// tag::icr-repl-create-pull-oneshot-callouts[]
880- <.> This a a one-shot replication because the `continuous` parameter defaults to `false`.
885+ <.> This a one-shot replication because the `continuous` parameter defaults to `false`.
881886
882887<.> The remote URL can also include the credentials for an existing Sync Gateway user on the remote server.
883888
884889// end::icr-repl-create-pull-oneshot-callouts[]
885890
886891
887892// tag::icr-repl-create-pull-cont[]
893+ {
888894// . . . other configuration entries
889- "db1-rep-id1-pull-cont" :
895+ "db1-rep-id1-pull-cont" : {
890896// tag::icr-repl-create-pull-cont-body[]
891- "replication_id" : " db1-rep-id1-pull-cont" ,
892- "direction" : " pull" ,
893- "continuous" : true // <.>
894- "purge-on-removal" : true ,
895- "remote" : " http://user:password@example.com:4985/db1-remote" ,
896- "filter" :" sync_gateway/bychannel" ,
897- "query_params" : {
898- "channels" : [" channel1.user1" ]
899- }
897+ "replication_id" : " db1-rep-id1-pull-cont" ,
898+ "direction" : " pull" ,
899+ "continuous" : true , // <.>
900+ "purge-on-removal" : true ,
901+ "remote" : " http://user:password@example.com:4985/db1-remote" , //<.>
902+ "filter" :" sync_gateway/bychannel" ,
903+ "query_params" : {
904+ "channels" : [" channel1.user1" ]
905+ }
900906// end::icr-repl-create-pull-cont-body[]
907+ }
901908// . . . other configuration entries
909+ }
902910// end::icr-repl-create-pull-cont[]
903911
904912// tag::icr-repl-create-pull-cont-callouts[]
@@ -908,7 +916,7 @@ Because it is also persistent, it will start automatically following Sync Gatewa
908916<.> The remote URL can also include the credentials for an existing Sync Gateway user on the remote server.
909917// end::icr-repl-create-pull-cont-callouts[]
910918
911-
919+ {
912920// tag::icr-repl-adhoc-pull-body[]
913921"replication_id" : " db1-rep-id1-pull-adhoc" ,
914922"adhoc" : true , // <.>
@@ -920,58 +928,66 @@ Because it is also persistent, it will start automatically following Sync Gatewa
920928 "channels" : [" channel1.user1" ]
921929}
922930// end::icr-repl-adhoc-pull-body[]
931+ }
923932
924933// tag::icr-repl-adhoc-pull-callouts[]
925934<.> Run this replication as an ad hoc one. It will run once only, process all changes but not survive Sync Gateway restarts
926935// end::icr-repl-adhoc-pull-callouts[]
927936
928937
929938// tag::icr-rep-sample-create-pull[]
930- "databases" : {
931- " db1" : { // <.>
939+ {
940+ "db1" : { // <.>
932941 "bucket" :" db1" ,
933942 "server" : " couchbase://cb-server" ,
934943 // ... other DB config ..
935944 "sgreplicate_enabled" : true , // <.>
936- "replications" :
937- "db1-rep-id1-pull-oneshot" : // <.>
938- // tag::icr-rep-sample-create-pull-body[]
939- "direction" : " pull" , // <.>
940- "remote" : " https://example.com:4984/remote_db1" ,
941- "user" : " user1" , // <.>
942- "password" : " password" ,
943- "batch_size" : 1000 , // <.>
944- "conflict_resolution_type" : " custom" , // <.>
945- "custom_conflict_resolver" : " " , // <.>
946- "continuous" : false , // <.>
947- "enable_delta_sync" : false , // <.>
948- "filter" : " sync_gateway/bychannel" , // <.>
949- "query_params" : [" channel.user1" ] // <.>
950- "max_backoff_time" : 5 , // <.>
951- "purge_on_removal" : false // <.>
952- "state" : " running" // <.>
953- // end::icr-rep-sample-create-pull-body[]
945+ "replications" : {
946+ "db1-rep-id1-pull-oneshot" : { // <.>
947+ // tag::icr-rep-sample-create-pull-body[]
948+ "direction" : " pull" , // <.>
949+ "remote" : " https://example.com:4984/remote_db1" ,
950+ "user" : " user1" , // <.>
951+ "password" : " password" ,
952+ "batch_size" : 1000 , // <.>
953+ "conflict_resolution_type" : " custom" , // <.>
954+ "custom_conflict_resolver" : " " , // <.>
955+ "continuous" : false , // <.>
956+ "enable_delta_sync" : false , // <.>
957+ "filter" : " sync_gateway/bychannel" , // <.>
958+ "query_params" : [" channel.user1" ], // <.>
959+ "max_backoff_time" : 5 , // <.>
960+ "purge_on_removal" : false , // <.>
961+ "state" : " running" , // <.>
962+ // end::icr-rep-sample-create-pull-body[]
963+ // ... other replication config ...
964+ }
965+ }
954966 }
955967}
956968// end::icr-rep-sample-create-pull[]
957969
958970// tag::icr-rep-sample-create-pull-callouts-full[]
959- <.> All replications are defined at database level within the context of a local database (e.g. `DB1`)
960- <.> Opt in to replication
961- <.> Define the `replication_id`
971+ <.> All replications are defined at database level within the context of a local database, for example `db1`.
972+ <.> Opt in to replication.
973+ <.> Define the `replication_id`.
962974// tag::icr-rep-sample-create-pull-callouts[]
963- <.> Pull changes from the `remote` database at the specified url. +
964- <.> Authenticate with the provided credentials. This user must have read and write access to both the local and remote databases. +
965- <.> Batch together up to 1000 revisions at a time. This improve replication performance but consumes more memory resources. +
966- <.> Apply a custom conflict resolution policy. +
975+ <.> Pull changes from the `remote` database at the specified url.
976+ <.> Authenticate with the provided credentials.
977+ This user must have read and write access to both the local and remote databases.
978+ <.> Batch together up to 1000 revisions at a time.
979+ This improves replication performance but consumes more memory resources.
980+ <.> Apply a custom conflict resolution policy.
967981<.> Provide a working Javascript function to apply the required resolution policy.
968- <.> By setting continuous=false, we are creating a one-shot replication. We could also have omitted this parameter as it defaults to `false`.
982+ <.> By setting continuous=`false`, this creates a one-shot replication.
983+ You could omit this parameter as it defaults to `false`.
969984<.> Don't use delta-sync; the default behavior.
970- <.> Filter documents by channel. +
971- <.> Replicate only those documents tagged with the channel names "user1". +
972- <.> Wait no more than 5 minutes between retries after network failure; default behavior. +
973- <.> Don't purge following removal of a channel; the default behavior. +
974- <.> Start the replicator immediately and on Sync Gateway node re(start);. We could also have omitted this parameter as this is the default behavior.
985+ <.> Filter documents by channel.
986+ <.> Replicate only those documents tagged with the channel names "user1".
987+ <.> Wait no more than 5 minutes between retries after network failure; default behavior.
988+ <.> Don't purge following removal of a channel; the default behavior.
989+ <.> Start the replicator immediately and on Sync Gateway node re(start);.
990+ You could omit this parameter as this is the default behavior.
975991// end::icr-rep-sample-create-pull-callouts[]
976992// end::icr-rep-sample-create-pull-callouts-full[]
977993
0 commit comments