[Migration] Get Podcasts / Episodes from PostgreSQL
[mygpo.git] / doc / dev / couchdb-views.rst
blob48a834719d2929e4446898b2de78362bb1300f45
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 Clients
19 ^^^^^^^
21 Doc-Types: User
23 **Views**
25 * `clients/by_ua_string <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/clients/views/by_ua_string>`_
28 Episode Statistics
29 ^^^^^^^^^^^^^^^^^^
31 Doc-Types: Episode
33 **Views**
35 * `episode_stats/filetypes <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_stats/views/filetypes>`_
38 Episodes
39 ^^^^^^^^
41 Doc-Types: Episode
43 **Views**
45 * `episodes/by_id <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_id>`_
46 * `episodes/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_podcast>`_
47 * `episodes/by_podcast_url <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/by_podcast_url>`_
48 * `episodes/need_update <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episodes/views/need_update>`_
51 Podcast Lists
52 ^^^^^^^^^^^^^
54 Doc-Types: PodcastList
56 **Views**
58 * `podcastlists/by_rating <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_rating>`_
59 * `podcastlists/by_user_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_user_slug>`_
60 * `podcastlists/random <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/random>`_
63 Podcasts
64 ^^^^^^^^
66 Doc-Types: Podcast, PodcastGroup, PodcastSubscriberData
68 **Views**
70 * `podcasts/by_id <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_id>`_
71 * `podcasts/by_language <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_language>`_
72 * `podcasts/by_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_slug>`_
73 * `podcasts/by_tag <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_tag>`_
74 * `podcasts/by_url <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_url>`_
75 * `podcasts/podcasts_groups <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/podcasts_groups>`_
76 * `podcasts/subscriber_data <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/subscriber_data>`_
79 Slugs
80 ^^^^^
82 Doc-Types: Podcast, PodcastGroup, Episode
84 **Views**
86 * `slugs/missing <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/slugs/views/missing>`_
89 Suggestions
90 ^^^^^^^^^^^
92 Doc-Types: Suggestions
94 **Views**
96 * `suggestions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/suggestions/views/by_user>`_
99 Tags
100 ^^^^
102 Doc-Types: Podcast, PodcastGroup
104 **Views**
106 * `tags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/tags/views/by_podcast>`_
109 Toplists
110 ^^^^^^^^
112 Doc-Types: Episode, Podcast, PodcastGroup
114 **Views**
116 * `toplist/episodes <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/toplist/views/episodes>`_
117 * `toplist/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/toplist/views/podcasts>`_
120 Trending
121 ^^^^^^^^
123 Doc-Types: Podcast, PodcastGroup
125 **Views**
127 * `trending/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/trending/views/podcasts>`_
130 Users
131 ^^^^^
133 Doc-Types: User
135 **Views**
137 * `users/by_google_email <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/by_google_email>`_
138 * `users/deleted <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/deleted>`_
141 Userdata
142 --------
144 This group of views is available in the *userdata* database, called
145 ``mygpo_userdata`` by default.
147 Chapters
148 ^^^^^^^^
150 Doc-Types: EpisodeUserState
152 **Views**
154 * `chapters/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/chapters/views/by_episode>`_
157 Episode Actions
158 ^^^^^^^^^^^^^^^
160 Doc-Types: EpisodeUserState
162 **Views**
164 * `episode_actions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_device>`_
165 * `episode_actions/by_podcast_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast_device>`_
166 * `episode_actions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast>`_
167 * `episode_actions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_user>`_
170 Episode States
171 ^^^^^^^^^^^^^^
173 Doc-Types: EpisodeUserState
175 **Views**
177 * `episode_states/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_podcast_episode>`_
178 * `episode_states/by_ref_urls <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_ref_urls>`_
179 * `episode_states/by_user_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_episode>`_
180 * `episode_states/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_podcast>`_
183 Favorites
184 ^^^^^^^^^
186 Doc-Types: EpisodeUserState
188 **Views**
190 * `episodes/favorites_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/favorites/views/episodes_by_user>`_
193 Heatmap
194 ^^^^^^^
196 Doc-Types: EpisodeUserState
198 **Views**
200 * `heatmap/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/heatmap/views/by_episode>`_
203 History
204 ^^^^^^^
206 Doc-Types: EpisodeUserState, PodcastUserState
208 **Views**
210 * `history/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_device>`_
211 * `history/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_user>`_
214 Listeners
215 ^^^^^^^^^
217 Doc-Types: EpisodeUserState
219 **Views**
221 * `listeners/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_episode>`_
222 * `listeners/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast_episode>`_
223 * `listeners/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast>`_
224 * `listeners/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user>`_
225 * `listeners/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user_podcast>`_
226 * `listeners/times_played_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/times_played_by_user>`_
229 Podcast States
230 ^^^^^^^^^^^^^^
232 Doc-Types: PodcastUserState
234 **Views**
236 * `podcast_states/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_device>`_
237 * `podcast_states/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_podcast>`_
238 * `podcast_states/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_user>`_
241 Subscribers
242 ^^^^^^^^^^^
244 Doc-Types: PodcastUserState
246 **Views**
248 * `subscribers/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscribers/views/by_podcast>`_
251 Subscriptions
252 ^^^^^^^^^^^^^
254 Doc-Types: PodcastUserState
256 **Views**
258 * `subscriptions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_device>`_
259 * `subscriptions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_podcast>`_
260 * `subscriptions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_user>`_
263 User-Tags
264 ^^^^^^^^^
266 Doc-Types: PodcastUserState
268 **Views**
270 * `usertags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/by_podcast>`_
271 * `usertags/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/by_user>`_
272 * `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>`_