TypeScript
this is the query i apply to it:
TypeScript
private filterQuery(query: string[], options?: GenericListOptions): string[] {
query = [
Query.orderDesc(options?.sortField || "$createdAt"),
Query.limit(options?.limit || 15),
Query.isNull("deletedAt"),
Query.select([
"$id",
"status",
"totalAmount",
"userId",
"items",
"address",
"$createdAt",
"$updatedAt",
"deletedAt",
]),
];
if (options?.status && options?.status != -2) {
query.push(Query.equal("status", options?.status));
}
if (options?.from && options?.to) {
query.push(Query.between("$createdAt", options?.from, options?.to));
}
return query;
}
TL;DR
The user is experiencing a 500 internal server error when applying a SELECT to their query. The error message suggests that queries on relationships are not supported. The user asks if one of the attributes is a relationship attribute.
Solution: The issue seems to be related to the usage of relationships in the query. It is suggested to check if any of the attributes being selected ("items" or "address") are relationship attributes. If they are, try removing them from the SELECT statement and see if the error persists.are one of those attributes a relationship attribute?
yeah address and items are relational
Queries on relationships are not supported
thanks, so i guess i just have to put ItemIds and addressId As their Attribute to exclude Items And Address.
Recommended threads
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...