Skip to content

Instantly share code, notes, and snippets.

@luk-
Created November 29, 2012 00:26
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 luk-/4165831 to your computer and use it in GitHub Desktop.
Save luk-/4165831 to your computer and use it in GitHub Desktop.
couch db replication using /_replicator db instead of /_replicate endpoint
{
"_id": "whatever",
"source": "http://some.couch.url/dbname",
"target": "local_dbname",
"continuous": true,
"user_ctx": {
"name": "user",
"roles": [
"_admin"
]
}
}
@luk-
Copy link
Author

luk- commented Nov 29, 2012

note: must have roles array with "_admin" in order to replicate views.

@luk-
Copy link
Author

luk- commented Nov 29, 2012

Unlike when you POST to the /_replicate endpoint, where you can add a "cancel": "true" property to end replication, this replication is canceled by DELETE-ing the doc created in the /_replicator db.

Note: you cannot directly alter documents in /_replicator with {"status": "triggered"}. Delete and recreate the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment