#Get the lastest number from string attribute

15 messages · Page 1 of 1 (latest)

bronze zealot
#

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),
  ])
tame zealot
bronze zealot
bronze zealot
cold dove
#

Or have a duplicate attribute, one with string and the other one with integer

tame zealot
bronze zealot
#

my attemption now is to havea ability to search startWith. because I have requirements to find all document's code start with something, interger cannot be search like that. and string cannot be use to generate the incremental number. I have heard auto increment coming in 1.7 . is this still valid

tame zealot
tame zealot
bronze zealot
bronze zealot
#

now, revert back to integer and only support equal search for integer, must be exact!

tame zealot