-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudant-designs.json
60 lines (60 loc) · 2.28 KB
/
cloudant-designs.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
"docs": [
{
"_id": "_design/images",
"views": {
"all": {
"map": "function (doc) {\n if (doc.type == \"image\") {\n emit(doc._id, 1);\n }\n}"
},
"by_video_id": {
"map": "function (doc) {\n if (doc.type == \"image\" && doc.video_id) {\n emit(doc.video_id, 1);\n }\n}"
},
"to_be_analyzed": {
"map": "function (doc) {\n if (doc.type == \"image\" && !doc.analysis) {\n emit(doc._id, 1);\n }\n}"
},
"processed_by_video_id": {
"map": "function (doc) {\n if (doc.type == \"image\" && doc.video_id && doc.analysis) {\n emit(doc.video_id, 1);\n }\n}",
"reduce": "_sum"
},
"total_by_video_id": {
"reduce": "_sum",
"map": "function (doc) {\n if (doc.type == \"image\" && doc.video_id) {\n emit(doc.video_id, 1);\n }\n}"
},
"standalone": {
"map": "function (doc) {\n if (doc.type == \"image\" && !doc.video_id) {\n emit(doc._id, 1);\n }\n}"
}
}
},
{
"_id": "_design/videos",
"views": {
"all": {
"map": "function (doc) {\n if (doc.type == \"video\") {\n emit(doc._id, { source: doc.source, title: doc.title});\n }\n}"
},
"to_be_analyzed": {
"map": "function (doc) {\n if (doc.type == \"video\" && !doc.metadata) {\n emit(doc._id, { source: doc.source, title: doc.title});\n }\n}"
}
}
},
{
"_id": "_design/audios",
"views": {
"all": {
"map": "function (doc) {\n if (doc.type == \"audio\") {\n emit(doc._id, doc.video_id);\n }\n}"
},
"to_be_analyzed": {
"map": "function (doc) {\n if (doc.type == \"audio\" && !doc.analysis) {\n emit(doc._id, doc.video_id);\n }\n}"
}
}
},
{
"_id": "_design/status",
"views": {
"current": {
"map": "function (doc) {\n if (doc.type === 'video') {\n emit([doc.type, doc.metadata ? 'done' : 'todo'], 1);\n }\n \n if (doc.type === 'image') {\n emit([doc.type, doc.analysis ? 'done' : 'todo'], 1);\n }\n \n if (doc.type === 'audio') {\n emit([doc.type, doc.analysis ? 'done' : 'todo'], 1);\n }\n\n}",
"reduce": "_count"
}
}
}
]
}