Parent Directory | Revision Log
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 | }; |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |