Skip to content

Commit

Permalink
mango: Fix specification of choose_best_index/1
Browse files Browse the repository at this point in the history
Comparators are not represented by binary strings in the selection
ranges, captured by the `range/0` type.  Although that is how they
are coming from the corresponding parsed JSON object, they are
being translated to specific atoms on the fly.

Noticed by:	nickva
  • Loading branch information
pgj authored and nickva committed Feb 16, 2023
1 parent 3fa8f72 commit 97fdac3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mango/src/mango_cursor_view.erl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ composite_prefix([Col | Rest], Ranges) ->
% In the future we can look into doing a cached parallel
% reduce view read on each index with the ranges to find
% the one that has the fewest number of rows or something.
-type range() :: {binary(), any(), binary(), any()} | empty.
-type comparator() :: '$lt' | '$lte' | '$eq' | '$gte' | '$gt'.
-type range() :: {comparator(), any(), comparator(), any()} | empty.

-spec choose_best_index(IndexRanges) -> Selection when
IndexRanges :: nonempty_list({#idx{}, [range()], integer()}),
Expand Down

0 comments on commit 97fdac3

Please sign in to comment.