Created
October 23, 2008 01:47
-
-
Save notch8-old/18894 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
| function depth_first_categories(category){ | |
| category.categories.forEach(function(category){ | |
| emit(category.name, category); | |
| depth_first_categories(category); | |
| } | |
| } | |
| function(doc) { | |
| if (doc['couchrest-type'] == 'CategoryList' && doc.categories) { | |
| doc.categories.forEach(function(category){ | |
| depth_first_categories(category); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment