Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 28 additions and 0 deletions.
  1. +28 −0 lists/refine.js
View
28 lists/refine.js
@@ -0,0 +1,28 @@
+/**
+ * Generates a simple array of json objects representing each doc in the db
+ * @author Max Ogden
+ */
+ function(head, req) {
+ var row, out, sep = '\n';
+
+ start({"headers":{"Content-Type" : "application/json"}});
+
+ if ('callback' in req.query) send(req.query['callback'] + "(");
+
+ send('{');
+ while ((row = getRow())) {
+ for (var header in row.value) {
+ if (row.value[header]) {
+ var value = row.value[header];
+ if (typeof(value) == "object") {
+ row.value[header] = "\"" + JSON.stringify(value) + "\"";
+ }
+ }
+ }
+ send(sep + '"":' + JSON.stringify(row.value));
+ sep = ',\n';
+ }
+ send("]");
+ if ('callback' in req.query) send(")");
+
+ };

No commit comments for this range

Something went wrong with that request. Please try again.