Merge branch 'master' into category-db
[mygpo.git] / doc / dev / couchdb-views.rst
blob7fd00fdfab143e179b9bb1f2ee5a6303983ac7eb
2 CouchDB Views
3 =============
5 This page describes the views that will be used in the CouchDB based backend of
6 the gpodder.net webservice.
8 The views are separated into groups, based on the databases they are indexed
9 on.
11 General
12 -------
14 This group of views is available on the general database, called ``mygpo`` by
15 default.
18 Chapters
19 ^^^^^^^^
21 Doc-Types: EpisodeUserState
23 **Views**
25 * `chapters/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/chapters/views/by_episode>`_
28 Clients
29 ^^^^^^^
31 Doc-Types: User
33 **Views**
35 * `clients/by_ua_string <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/clients/views/by_ua_string>`_
38 Episode Actions
39 ^^^^^^^^^^^^^^^
41 Doc-Types: EpisodeUserState
43 **Views**
45 * `episode_actions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_device>`_
46 * `episode_actions/by_podcast_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast_device>`_
47 * `episode_actions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast>`_
48 * `episode_actions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_user>`_
51 Episode States
52 ^^^^^^^^^^^^^^
54 Doc-Types: EpisodeUserState
56 **Views**
58 * `episode_states/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_podcast_episode>`_
59 * `episode_states/by_ref_urls <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_ref_urls>`_
60 * `episode_states/by_user_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_episode>`_
61 * `episode_states/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_podcast>`_
64 Episode Statistics
65 ^^^^^^^^^^^^^^^^^^
67 Doc-Types: Episode
69 **Views**
71 * `episode_stats/filetypes <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_stats/views/filetypes>`_
74 Episodes
75 ^^^^^^^^
77 Doc-Types: Episode
79 **Views**
81 * `episodes/by_id <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_id>`_
82 * `episodes/by_oldid <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_oldid>`_
83 * `episodes/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_podcast>`_
84 * `episodes/by_podcast_url <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_podcast_url>`_
85 * `episodes/by_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_slug>`_
86 * `episodes/need_update <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/need_update>`_
89 Favorites
90 ^^^^^^^^^
92 Doc-Types: EpisodeUserState
94 **Views**
96 * `episodes/favorites_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/favorites/views/episodes_by_user>`_
99 Heatmap
100 ^^^^^^^
102 Doc-Types: EpisodeUserState
104 **Views**
106 * `heatmap/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/heatmap/views/by_episode>`_
109 History
110 ^^^^^^^
112 Doc-Types: EpisodeUserState, PodcastUserState
114 **Views**
116 * `history/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_device>`_
117 * `history/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_user>`_
120 Listeners
121 ^^^^^^^^^
123 Doc-Types: EpisodeUserState
125 **Views**
127 * `listeners/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_episode>`_
128 * `listeners/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast_episode>`_
129 * `listeners/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast>`_
130 * `listeners/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user>`_
131 * `listeners/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user_podcast>`_
132 * `listeners/times_played_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/times_played_by_user>`_
135 Podcast Lists
136 ^^^^^^^^^^^^^
138 Doc-Types: PodcastList
140 **Views**
142 * `podcastlists/by_rating <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_rating>`_
143 * `podcastlists/by_user_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_user_slug>`_
144 * `podcastlists/random <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/random>`_
147 Podcast States
148 ^^^^^^^^^^^^^^
150 Doc-Types: PodcastUserState
152 **Views**
154 * `podcast_states/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_device>`_
155 * `podcast_states/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_podcast>`_
156 * `podcast_states/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_user>`_
159 Podcasts
160 ^^^^^^^^
162 Doc-Types: Podcast, PodcastGroup, PodcastSubscriberData
164 **Views**
166 * `podcasts/by_id <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_id>`_
167 * `podcasts/by_language <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_language>`_
168 * `podcasts/by_last_update <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_last_update>`_
169 * `podcasts/by_oldid <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_oldid>`_
170 * `podcasts/by_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_slug>`_
171 * `podcasts/by_tag <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_tag>`_
172 * `podcasts/by_url <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_url>`_
173 * `podcasts/flattr <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/flattr>`_
174 * `podcasts/groups_by_oldid <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/groups_by_oldid>`_
175 * `podcasts/podcasts_groups <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/podcasts_groups>`_
176 * `podcasts/random <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/random>`_
177 * `podcasts/subscriber_data <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/subscriber_data>`_
180 Slugs
181 ^^^^^
183 Doc-Types: Podcast, PodcastGroup, Episode
185 **Views**
187 * `slugs/missing <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/slugs/views/missing>`_
190 Subscribers
191 ^^^^^^^^^^^
193 Doc-Types: PodcastUserState
195 **Views**
197 * `subscribers/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscribers/views/by_podcast>`_
200 Subscriptions
201 ^^^^^^^^^^^^^
203 Doc-Types: PodcastUserState
205 **Views**
207 * `subscriptions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_device>`_
208 * `subscriptions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_podcast>`_
209 * `subscriptions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_user>`_
212 Suggestions
213 ^^^^^^^^^^^
215 Doc-Types: Suggestions
217 **Views**
219 * `suggestions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/suggestions/views/by_user>`_
222 Tags
223 ^^^^
225 Doc-Types: Podcast, PodcastGroup
227 **Views**
229 * `tags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/tags/views/by_podcast>`_
230 * `tags/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/tags/views/by_user>`_
233 Toplists
234 ^^^^^^^^
236 Doc-Types: Episode, Podcast, PodcastGroup
238 **Views**
240 * `toplist/episodes <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/toplist/views/episodes>`_
241 * `toplist/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/toplist/views/podcasts>`_
244 Trending
245 ^^^^^^^^
247 Doc-Types: Podcast, PodcastGroup
249 **Views**
251 * `trending/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/trending/views/podcasts>`_
254 Users
255 ^^^^^
257 Doc-Types: User
259 **Views**
261 * `users/by_google_email <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/by_google_email>`_
262 * `users/deleted <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/deleted>`_
265 User-Tags
266 ^^^^^^^^^
268 Doc-Types: PodcastUserState
270 **Views**
272 * `usertags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/by_podcast>`_
273 * `usertags/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/podcasts>`_
278 Categories
279 ----------
281 This group of views is available on the categories database, called
282 ``mygpo_categories`` by default.
285 Categories
286 ^^^^^^^^^^
288 Doc-Types: Category
290 **Views**
292 * `categories/by_tags <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/categories/views/by_tags>`_
293 * `categories/by_update <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/categories/views/by_update>`_
296 Pubsub
297 ------
299 The following views and design documents relate to the "pubsub" database.
301 Subscriptions
302 ^^^^^^^^^^^^^
304 Doc-Types: Subscription
306 **Views**
308 * `subscriptions/by_topic <https://github.com/gpodder/mygpo/tree/master/couchdb/pubsub/_design/subscriptions/views/by_topic>`_