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
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.