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
- Appwrite Sites: ERR_TOO_MANY_REDIRECTS o...
So, my domain was working perfectly fine with Vercel. I was using cloudflare CDN (still am) but CNAME was DNS-only. I switched over to appwrite, CNAME is still ...
- Charged after Downgrade
I downgraded from the pro plan last month, but it’s still trying to charge my card this month and my account has been restricted
- Invalid type for attribute 'email': emai...
I'm using the node-appwrite SDK to create a table, the column payload looks like this: ```json [{"key":"email","type":"email","required":true, "size": 512}] ``...