Skip to content

Commit

Permalink
Fix sorting multiple fields when the first is equal between documents
Browse files Browse the repository at this point in the history
  • Loading branch information
erikolson186 committed May 12, 2017
1 parent d69f15e commit 452057b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = (_next, spec) => {
for (var [path_pieces, order] of sorts) {
const result = compare(a, b, path_pieces, order);

if (result !== null) { return result; }
if (result > 0 || result < 0) { return result; }
}

return -order;
Expand Down

0 comments on commit 452057b

Please sign in to comment.