Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

Order by calculated value

Open MaticDiba opened this issue 1 year ago • 1 comments

Is it possible to order items by calculated value? For example: if I have a list of points and I would like to get the closest points to my location. I could calculate the distance with a simple formula: Math.hypot(endX - startX, endY - startY).

Is it possible to use this with built-in functions and then use this value for a sort?

MaticDiba avatar Mar 20 '23 16:03 MaticDiba

The only option is to query the entire result and do the sorting in your app or library.

dfahlander avatar Mar 21 '23 00:03 dfahlander