summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/files/designs/customers
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-11-22 11:14:52 -0800
committerelijah <elijah@riseup.net>2013-11-22 11:14:52 -0800
commit7674e38867762e5f9d1d1392ccaf89f9ba621008 (patch)
treed8d865919130b5859902cbd47adf52e3fc493d59 /puppet/modules/site_couchdb/files/designs/customers
parent289a00a149ac08d01b8ee638620d8c2928966fa3 (diff)
parent481e945b3c8ea6bcb1de501b925d4332b1275c2d (diff)
Merge branch 'develop' of ssh://leap.se/leap_platform into develop
Diffstat (limited to 'puppet/modules/site_couchdb/files/designs/customers')
-rw-r--r--puppet/modules/site_couchdb/files/designs/customers/Customer.json18
1 files changed, 18 insertions, 0 deletions
diff --git a/puppet/modules/site_couchdb/files/designs/customers/Customer.json b/puppet/modules/site_couchdb/files/designs/customers/Customer.json
new file mode 100644
index 00000000..1b4bbddd
--- /dev/null
+++ b/puppet/modules/site_couchdb/files/designs/customers/Customer.json
@@ -0,0 +1,18 @@
+{
+ "_id": "_design/Customer",
+ "language": "javascript",
+ "views": {
+ "by_user_id": {
+ "map": " function(doc) {\n if ((doc['type'] == 'Customer') && (doc['user_id'] != null)) {\n emit(doc['user_id'], 1);\n }\n }\n",
+ "reduce": "_sum"
+ },
+ "by_braintree_customer_id": {
+ "map": " function(doc) {\n if ((doc['type'] == 'Customer') && (doc['braintree_customer_id'] != null)) {\n emit(doc['braintree_customer_id'], 1);\n }\n }\n",
+ "reduce": "_sum"
+ },
+ "all": {
+ "map": " function(doc) {\n if (doc['type'] == 'Customer') {\n emit(doc._id, null);\n }\n }\n"
+ }
+ },
+ "couchrest-hash": "688c401ec0230b75625c176a88fc4a02"
+} \ No newline at end of file