Hi guys. I'm using Appwrite Cloud, and I'm using version 21 of node-appwrite to benefit from transactions. The problem is I seem to be getting an error when I use Query.equal:
AppwriteException: Invalid query method: equal at _Client.call (file:///usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:294:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Module.default (file:///usr/local/server/src/function/src/main.js:85:24) at async execute (/usr/local/server/src/server.js:220:16) at async action (/usr/local/server/src/server.js:237:7) at async /usr/local/server/src/server.js:26:5
The relevant excerpt of the code in question that uses it is as follows:
else if(req.bodyJson.drawId){ //This means we tried to start a new conversation
//We first check if we've already created a conversation with a matching draw
//If we have already, we return that
log("Trying to start a convo");
const existingConvo = await database.listRows({
databaseId: "68c2503d0005d71c2f12",
tableId: "journal_conversations",
queries: [
Query.equal("userId", userId),
Query.equal("draw.$id", req.bodyJson.drawId),
Query.select(['*', 'draw.*', 'draw.card.*'])
]
});
Is this a compatibility issue with the cloud?
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).
Maybe userId is invalid?
No the column is properly named and the variable I'm checking against is defined, so thats not it.
Actually looking at it, I gave the wrong part - the error seems to be in this line:
databaseId: "68c2503d0005d71c2f12",
tableId: "draws",
rowId: req.bodyJson.drawId,
queries: [
Query.equal("userId", userId),
Query.select(['*', 'card.*'])
]
}); ```
Is it that getRow doesn't support queries?
Recommended threads
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...
- Backup policies think im on free tier
Cant create more than one policy as im told to ugprade, when clicking upgrade im taken to the upgrade page which confirms im already on pro
- Cant get rid of "get started"
Not that important, but annoying. No matter what I do I cant get the "Get started" to go away, ive added a bunch of web platforms and its just stuck.