Skip to content
Back

[CLOSED] Unknown column 'profile' in 'where clause'

  • 0
  • Self Hosted
  • Databases
Guille
28 Aug, 2023, 16:50

I'm trying to get a list of documents with the following code:

TypeScript
  const lastQueries = [Query.orderDesc("date"), Query.limit(1), Query.equal("profile", profile.$id)];
  const lastMarkin = await databases.listDocuments<MarkinProps>(DATABASE_INTERNAL, "markin", lastQueries);

And I get this error:

TypeScript
appwrite  | [Error] Timestamp: 2023-08-28T16:38:52+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
appwrite  | [Error] Type: PDOException
appwrite  | [Error] Message: Unknown column 'profile' in 'where clause'
appwrite  | [Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php
appwrite  | [Error] Line: 64

This happens only when I add Query.equal("profile", profile.$id).

The markin collection have this attributes: workday (relationship), profile (relationship), date and isComputed and a unique index for the date attribute.

I have tried, recreating the markin collection but I keep having the same error

I'm on appwrite v1.3.7 node-appwrite v9.0.0

I haven't migrating recently, it was working before. The only recently change was to add markin relational attribute to a workday

Any clue on how to solve this?

TL;DR
I'm getting an error message saying "Unknown column 'profile' in 'where clause'" when trying to query a collection in Appwrite. This error occurs when I add `Query.equal("profile", profile.$id)` to the code. I have not made any recent migrations, and the only recent change was adding the `markin` relational attribute to a `workday`. Any suggestions on how to solve this?
Binyamin
28 Aug, 2023, 17:04

I don't think you can query relationship fields

Guille
28 Aug, 2023, 17:28

Yeah you're right, I totally forgot that! 😅

Guille
28 Aug, 2023, 17:29

[CLOSED] Unknown column 'profile' in 'where clause'

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