-
Notifications
You must be signed in to change notification settings - Fork 461
/
accounts.json
31 lines (31 loc) · 1.8 KB
/
accounts.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"_id":"_design/accounts"
,"language":"javascript"
,"views": {
"listing_by_id": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; var t = doc.pvt_tree.slice(0); t.push(doc._id); emit([doc._id, t], {'id': doc._id, 'name': doc.name}); }"
}
,"listing_by_parent": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; var t = doc.pvt_tree.slice(0); t.push(doc._id); emit(doc._id, {'id': t.slice(-2,-1)[0]}); }"
}
,"listing_by_children": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; var t = doc.pvt_tree.slice(0); t.push(doc._id); emit([t.slice(-2,-1)[0], t], {'id': doc._id, 'name': doc.name}); }"
}
,"listing_by_descendants": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; var t = doc.pvt_tree.slice(0); t.push(doc._id); for (var i in t) { emit([t[i], t], {'id': doc._id, 'name': doc.name}); } }"
},
"listing_by_api": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; emit(doc.pvt_api_key, {'account_id': doc._id}); }"
},
"listing_by_realm": {
"map":"function(doc) { if (doc.pvt_type != 'account' || doc.pvt_deleted) return; emit(doc.realm, {'account_id': doc._id, 'account_db': doc.pvt_account_db}); }"
},
"group_by_realm": {
"map": "function(doc) { if(doc.pvt_type != 'account' || doc.pvt_deleted) return; emit( doc.realm, doc._id ); }",
"reduce": "function(key, values, rereduce) { if (rereduce) return values; else return values[0]; }"
}
}
,"filters": {
"export":"function(doc, req) { return ( doc.pvt_type == 'account' ); }"
}
}