Skip to content

Commit

Permalink
API: List of empty viewpoints for bulk delete (#6).
Browse files Browse the repository at this point in the history
  • Loading branch information
benel committed Mar 15, 2016
1 parent cb64f81 commit ad9388e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lists/empty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function() {
provides('json', function() {
var docs = [];
while (r = getRow()) {
docs.push({
_id: r.doc._id,
_rev: r.doc._rev,
_deleted: true
});
}
send(JSON.stringify({docs: docs}));
});
}
6 changes: 6 additions & 0 deletions rewrites.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"query": {
"key": [":resource"]
}
}, {
"from": "empty",
"to": "_list/empty/empty",
"query": {
"include_docs": "true"
}
}, {
"from": "",
"to": "../../",
Expand Down
5 changes: 5 additions & 0 deletions views/empty/map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function(o) {
if (o.viewpoint_name && !o.topics) {
emit();
}
}

0 comments on commit ad9388e

Please sign in to comment.