I have these three collections namely users
, schools
, and assignment
. The assignment collection has a relationship to school
and user
mainly one to many (one school/user, many assignment) relationships. How do I query all schools that have been assigned to that assignment?
Queries on relationships are not supported at the moment
ohh okay, I guess I'll just fetch all data from the db then filter it out my code. thank you
A workaround could be to include the school ID in the assignments collection and then query against that
I already have that, the assignments collection contain attributes of user and schools but how can I get all the schools that is assigned to an assignment?
for example I have this 9 assignments with different school ID and linked to a user how can I query that?
finding the assignments that assigned on the user can be using Query.equal("user", [user_id])
. but how do I only get all schools that has been assigned to the user in the assignment collection?\
that query should give you all assignments where user == user_id...and so each of those assignments has a school. so what part are you stuck on?
Recommended threads
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.