Closed keithnorm closed 7 years ago
Thank you for pointing this out and suggesting a fix. I went ahead and verified the bug and made the following commit:
https://github.com/erikolson186/zangodb/commit/452057b830915cd556856005ba4dc0292cab228c
Great thanks!
I believe because of this line https://github.com/erikolson186/zangodb/blob/master/src/sort.js#L48 when sorting on multiple fields, if the first field comes back from compare with a result of
0
the sort returns without evaluating the second field.I think the fix is to just change that line to:
if (result !== null && result !== 0) { return result; }
.