/[couchdb]/deploy/reblog.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /deploy/reblog.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8 - (hide annotations)
Tue Aug 5 17:04:54 2008 UTC (15 years, 8 months ago) by dpavlin
File MIME type: text/plain
File size: 722 byte(s)
small deploy script for reblog database
1 dpavlin 8 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6     use CouchDB::Deploy;
7    
8    
9     my $reduce_count = qq|
10     function (Key, Values) {
11     var sum = 0;
12     for(var i in Values)
13     sum += Values[i];
14     return sum;
15     }
16     |;
17    
18     db 'reblog/', containing {
19     doc {
20     _id => '_sync',
21     key => '_sync',
22     last_row_id => 0,
23     };
24     design {
25     _id => '_design/count',
26     language => 'javascript',
27     views => {
28     'items' => {
29     'map' => qq|
30     function(doc) {
31     emit(doc.feed_title, 1);
32     }
33     |,
34     'reduce' => $reduce_count,
35     },
36     'tags' => {
37     'map' => qq|
38     function(doc) {
39     var tags = doc.category.split(/[\\s\/]/);
40     for(var i in tags) {
41     emit(tags[i], 1);
42     }
43     }
44     |,
45     'reduce' => $reduce_count,
46     }
47     },
48     };
49     };

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26