I am executing Appwrite Function from react, getting below error for fetching data from table in function.
Code snippet where function throw this error:
const records = await database.listRows({ databaseId: config.appwrite.databaseId, tableId: config.collections.jobApply, queries: [Query.equal('candidateId', candidateId), Query.limit(5000)], });
Function details: Function is deployed with Node.js-22 on cloud. i am using "node-appwrite": "^19.0.0" in appwrite function.
error: AppwriteException: Route not found, Please ensure the endpoint is configured correctly and that the API route is valid for this SDK version.
Try the following code -
const records = await database.listRows(
config.appwrite.databaseId,
config.collections.jobApply,
[
Query.equal('candidateId', candidateId),
Query.limit(5000)
]
);
And have you double checked that your endpoint, api key & project id are correctly set?
No sure, if this will work:
listRows(
config.appwrite.databaseId,
config.collections.jobApply,
[
Query.equal('candidateId', candidateId),
Query.limit(5000)
]
)
listRows() function except object as params.
yes, i have checked all the config values: endpoint, api key and projectId
Ok. Then try using this older version (of the same code you've written) and let me know the output -
const records = await databases.listDocuments({
databaseId: config.appwrite.databaseId,
collectionId: config.collections.jobApply,
queries: [
Query.equal("candidateId", candidateId),
Query.limit(5000)
]
});
hi, I tried older version as well. but it didn't work. I have two projects on cloud: dev and production. both have same config settings. it is working for dev but not for produciotn.
Have you checked for versions on both dev & production? Are they both "^19.0.0"? Please check if there's any verison mismatch b/w them..
yes, same version on both.
Is your project struture, table name, columns name etc. are same on both production & dev? Are you using row based database on both?
Can you share more info about your outputs on both production & dev? This will help me understand it in a much better way
- yes, everything is same: project structure, table name, columns names.
- what do you mean by row based database? do you mean latest node.js library which support listRows() ?
I am using "node-appwrite": "^19.0.0" in appwrite function.
- I have created two projects on Appwrite cloud, both projects (HBG-dev and HBG) contains Job_Manager Function. function code is same, because these funcations are connected to same github repo. so when ever i push new changes, it automatically update my both functions on appwrite cloud.
both Function is using "node-appwrite": "^19.0.0".
Code snippet where function throw error:
const records = await database.listRows({ databaseId: config.appwrite.databaseId, tableId: config.collections.jobApply, queries: [Query.equal('candidateId', candidateId), Query.limit(5000)], });
HBG-dev project: it works fine. HBG project: it throw error.
Yes I mean the listRows() one only! And I meant, are you using that latest table based DB on both production & dev? Or are using the old collection based DB in either of them?
No, it new table based DB for both production & dev
If you don't mind, can you share the complete code of the file in which you've written this part? You can DM it if you're not comfortable sharing it here. I believe there must definitely be something we both are missing out..
I myself have encountered many errors because of my own silly mistakes.. I hope we'll be able to resolve this soon once I'll see where and how you're using it
Recommended threads
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.