ios - DB Scheme tables -


i db newbie, , working on apps db scheme, , came wall in representing 1 of tables. working parse db starter db until app rolling. in parse db have tv show entity, episode entity (one many relationship) , user entity. have entered few tv-shows parse db. want able follow episodes user has viewed. until have created array of episodes user have viewed , when want them fetch them, seems bit tedious , inefficient.

my q is, there way else represent relationship between viewed episodes user.

thanks :)

you create new table called watchedepisodes. table contain 2 pointers. first pointer userpointer , second episodepointer. can run following code episodes currentuser has watched.

swift

var query = pfquery(classname: "watchedepisodes") query.wherekey("userpointer", equalto: pfuser.currentuser()) query.find({     //handle success , error }); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -