
Okay ive just created a movie_liked
collection where each document contain :
- movieId : integer
- userId : relationship attribut with the
user
collection
But when I try to add an index call isMovieLiked
with these attribut movieId and userId. I cant add the userId attribut he dont appear

or I can add another userId attribut with string type

There's no need to make an index with a relationship attribute

Im kidna lost, I was thinking a relationship attribute was a normal attribut but with a connected value. Like in my case for the movie_liked collection, i have :
- movieId : integer
- userId : relationship attribut with the usercollection
So I want to be able to get the movie liked by an user so I need an index with movieId AND userId right ?

Or relationship isnt a value, but just a way to link documents each others ?

Did you try to query? What happened?

So sorry that my bad

Its working perfectly with userId (relationship attribut) and movieId

[SOLVED] Add index with "relationship" type Attribut

Update: I finally have to check everytime if user already like the post or not to prevent duplicate like u was right

Huh?

Sry I was just saying that when an user like a playlist, I have to check if this same user has already liked the playlist

hmmmmmmm i see....i wonder if it's worth it to make the attribute in the movie_liked collection a relationship then..

btw, you might want to 👍🏼 this issue: https://github.com/appwrite/appwrite/issues/5400
Recommended threads
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
