Created
November 22, 2012 03:34
-
-
Save goog/4129321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"lists": "{\"likes\": \" function(head,req){ \n\tvar row;\n\tvar likes = req.like.split(\" \"); \n\twhile(row=getRow()) {\n\t keys= row.key.split(\" \"); \n\t for (var i=0;i<likes.length;i++) {\n\t if(keys.indexOf(likes[i]) != -1) \n\t\t{send(row); break;}\n\t\t}\n\t}}\"\n}" | |
{"likes": " function(head,req){ | |
var row; | |
var likes = req.like.split(" "); | |
while(row=getRow()) { | |
keys= row.key.split(" "); | |
for (var i=0;i<likes.length;i++) { | |
if(keys.indexOf(likes[i]) != -1) | |
{send(row); break;} | |
} | |
}}" | |
} | |
Note: Try to avoid backslash + double quote and new lines in the design function using temporary views. Using them will raise the error "JSON.parse: bad control character in string literal". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment