Back

Retrieving Ids if relationship attribute(Array of Ids) contains userId

  • 0
  • Android
  • React Native
  • Databases
Chanaka
29 Aug, 2024, 04:34

hi there I am struggling with quearing ids

I have two collecctions called users and videos. Users can like videos then I saved those in videos collection using relationship attribute called likedBy which is array of user ids . It has one way relationship with many to many. So how I can retrieve all videos liked by a user?

TL;DR
Developers are having trouble querying ids from two collections, users and videos. Videos have a relationship attribute likedBy which is an array of user ids. They are looking for a way to retrieve all videos liked by a specific user. Solution: To retrieve all videos liked by a specific user, developers can query the videos collection where the likedBy array contains the user's id.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more