Okay Im trying to build a kind of IMDB / TMDB app where user can like, mark as seen, etc... movie. So what the best way to store these datas ? Create one collection per type of reaction. For example :
- Collection Movie_Rated
- Collection Movie_Liked
- Collection Movie_Watched
Or make only one collection like :
- User_Movie where each document is contain a user id, movie id, if liked, if watched and if rated
idk what the best way, instinctively I would say the second one to get all data in one api call
Best way: create a function to add 1 when someone likes anything and remove 1 when like is removed
So you will need to have a likes collection to prevent the same user liking it 2 times
when u say a function, u are no talking about Appwrite function right ? So its better to have one collection per type of reaction ?
Mhh but if I have juste one collection with a document for each movie and each user example :
- userId: 854d5g84dr25g54drg
- movieId: 597
- like: true
- watched: true
- rated: 8
How its possible to havbe an user liking 2 times ?
Yes, I'm talking about appwrite function
Respect to collection, yes, probably
The user creates 2 documents for the same film, so you get 2 likes
Instead, use a function that checks if it exists or not a document for the same film from the same user
Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...