Rovar2000Original post
Rank 2: Process
Plain text
this is the query i apply to it:
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;
}
Summary
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.