WatermelonDB
WatermelonDB copied to clipboard
Inconsistent ordering when using LokiJSAdapter
When using LokiJSAdapter in my project's tests, Q.sortBy is supposedly not working correctly.
For example, I have an entity that has an "order" property:
// Entity 1: { id: "foo", order: "0"}
// Entity 2: { id: "bar", order: "1"}
When I set Q.sortBy("order", Q.asc), Entity 1 comes first. At this moment everything is fine!
If I define the following:
// Entity 1: { id: "foo", order: "0V"} <-- different order value
// Entity 2: { id: "bar", order: "1"}
In this case, the same statement - Q.sortBy("order", Q.asc) - returns Entity 2 as the first element.
But in javascript, "0V" < "1".
Am I doing something wrong or is there an inconsistency?
Facing same issue.