Lets suppose 2 documents are added to the
_replicator database in the following order:
{
"_id": "doc_A",
"source": "http://myserver.com:5984/foo",
"target": "bar"
}and
{
"_id": "doc_B",
"source": "http://myserver.com:5984/foo",
"target": "bar"
}
Both describe exactly the same replication (only their
_ids differ). In this case document
doc_A triggers the replication, getting
updated by CouchDB with the fields
_replication_state,
_replication_state_time and
_replication_id, just like it was described
before. Document doc_B however, is only
updated with one field, the _replication_id
so it will look like this:
{
"_id": "doc_B",
"source": "http://myserver.com:5984/foo",
"target": "bar",
"_replication_id": "c0ebe9256695ff083347cbf95f93e280"
}
While document doc_A will look like this:
{
"_id": "doc_A",
"source": "http://myserver.com:5984/foo",
"target": "bar",
"_replication_id": "c0ebe9256695ff083347cbf95f93e280",
"_replication_state": "triggered",
"_replication_state_time": 1297974122
}
Note that both document get exactly the same value for the
_replication_id field. This way you can
identify which documents refer to the same replication - you can
for example define a view which maps replication IDs to document
IDs.