I have client table whcih contains code, was initially interger field, but since it doesn't support full searching. I need to change to string and store it.
But when I try to get the last order number. it doesn't return the correct biggest number. any possible solution or workaround for this
TypeScript
const promise: any = await db.clients.list([
Query.orderDesc("code"),
Query.limit(1),
])
TL;DR
Developers need to get the latest number from a string attribute in a client table. Changing the integer field to a string attribute has caused issues in returning the correct biggest number. A solution could be to ensure proper sorting in the query to get the desired result. The code snippet provided looks for the last code in descending order and limits the result to 1.Recommended threads
- HTTP Error 500 ''
Hello to everyone, I'm a Flutter developer and actually I'm developing an app using Appwrite.. during my tests and also massive ones I've noticed something we...
- CSV imports were not working but found a...
With 1.9.5 Self-Hosted on a remote Debian 13 VPS I was trying to upload some data using the Import from CSV function. After following the Docs I created a csv f...
- Inviting members while SMTP is disabled ...
Issue: https://github.com/appwrite/console/issues/3125 PR: https://github.com/appwrite/console/pull/3126