How to write for numbers search in LIKE operator

Hi All,

I am using below search on string data types , it was working. But integer data types keys, search with LIKE operation not working.

document:
{"_type":“Devices”,
“id”:“57cc2900-b950-409b-ab71-4d588a0db2ec”,
“device_type”:“metro”,
“store_number”:9911,
“created_at”:“2021-05-27T17:50:27.968Z”,
“updated_at”:“2021-05-28T10:15:19.510Z”}

select * from YYY_BUCKET where _type=“Devices” and device_type like “Metr%”

I need to search store_number LIKE 99%, how do write query in number types?

Thanks

LIKE is meant for string search. You need convert number to string then do search.

TO_STR(store_number) LIKE "99%"

1 Like

Thanks for the solution @vsr1