add filter generic/is_types
authorStefan Kögl <stefan@skoegl.net>
Sat, 17 Aug 2013 11:51:48 +0000 (17 11:51 +0000)
committerStefan Kögl <stefan@skoegl.net>
Sat, 17 Aug 2013 11:51:48 +0000 (17 11:51 +0000)
couchdb/general/_design/generic/filters/is_types.js [new file with mode: 0644]

diff --git a/couchdb/general/_design/generic/filters/is_types.js b/couchdb/general/_design/generic/filters/is_types.js
new file mode 100644 (file)
index 0000000..1c95ece
--- /dev/null
@@ -0,0 +1,9 @@
+function(doc, req)
+{
+    if(doc._deleted)
+    {
+        return false;
+    }
+
+    return (doc.doc_type && (req.query.doc_types.indexOf(doc.doc_type) > -1));
+}