Add scripts to create myops-getqueryview:
[myops.git] / web / query / views / comments / map.js
diff --git a/web/query/views/comments/map.js b/web/query/views/comments/map.js
new file mode 100644 (file)
index 0000000..60380b0
--- /dev/null
@@ -0,0 +1,10 @@
+function(doc) {
+  // !code helpers/md5.js
+  if (doc.type == "comment") {
+    if (doc.commenter && doc.commenter.email && !doc.commenter.gravatar_url) {
+      // todo normalize this schema-ness
+      doc.commenter.gravatar = hex_md5(doc.commenter.email);      
+    }
+    emit(new Date(doc.created_at), doc);
+  }
+};
\ No newline at end of file