diff options
author | Azul <azul@riseup.net> | 2014-04-09 11:53:26 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2014-04-10 18:54:22 +0200 |
commit | 740cb615eae69235a649583359e23d834df0d7b5 (patch) | |
tree | cf37eab3d264b63449e28968a8abe88671f9485c /puppet/modules/site_couchdb/files/designs/shared/syncs.json | |
parent | 98ed287783baad657bb2b0297de34629d14bb2f3 (diff) |
#5315 update soledad design docs
Diffstat (limited to 'puppet/modules/site_couchdb/files/designs/shared/syncs.json')
-rw-r--r-- | puppet/modules/site_couchdb/files/designs/shared/syncs.json | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/puppet/modules/site_couchdb/files/designs/shared/syncs.json b/puppet/modules/site_couchdb/files/designs/shared/syncs.json index 0df5ff74..bab5622f 100644 --- a/puppet/modules/site_couchdb/files/designs/shared/syncs.json +++ b/puppet/modules/site_couchdb/files/designs/shared/syncs.json @@ -1,11 +1,11 @@ { - "views" : { - "log" : { - "map" : "function(doc) {\n if (doc._id == 'u1db_sync_log') {\n if (doc.syncs)\n doc.syncs.forEach(function (entry) {\n emit(entry[0],\n {\n 'known_generation': entry[1],\n 'known_transaction_id': entry[2]\n });\n });\n }\n}\n" + "_id": "_design/syncs", + "updates": { + "put": "function(doc, req){\n if (!doc) {\n doc = {}\n doc['_id'] = 'u1db_sync_log';\n doc['syncs'] = [];\n }\n body = JSON.parse(req.body);\n // remove outdated info\n doc['syncs'] = doc['syncs'].filter(\n function (entry) {\n return entry[0] != body['other_replica_uid'];\n }\n );\n // store u1db rev\n doc['syncs'].push([\n body['other_replica_uid'],\n body['other_generation'],\n body['other_transaction_id']\n ]);\n return [doc, 'ok'];\n}\n\n" + }, + "views": { + "log": { + "map": "function(doc) {\n if (doc._id == 'u1db_sync_log') {\n if (doc.syncs)\n doc.syncs.forEach(function (entry) {\n emit(entry[0],\n {\n 'known_generation': entry[1],\n 'known_transaction_id': entry[2]\n });\n });\n }\n}\n" } - }, - "_id" : "_design/syncs", - "updates" : { - "put" : "function(doc, req){\n if (!doc) {\n doc = {}\n doc['_id'] = 'u1db_sync_log';\n doc['syncs'] = [];\n }\n body = JSON.parse(req.body);\n // remove outdated info\n doc['syncs'] = doc['syncs'].filter(\n function (entry) {\n return entry[0] != body['other_replica_uid'];\n }\n );\n // store u1db rev\n doc['syncs'].push([\n body['other_replica_uid'],\n body['other_generation'],\n body['other_transaction_id']\n ]);\n return [doc, 'ok'];\n}\n\n" } -} +}
\ No newline at end of file |