diff options
author | Gabor Pali <gabor.pali@ibm.com> | 2023-02-16 02:57:24 +0100 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2023-02-15 22:14:19 -0500 |
commit | 97fdac3af36c378a3fe634942c3ac76e785f16de (patch) | |
tree | adc17ab191d1b88e60bd251e2bb3ac1deb023717 /src/mango | |
parent | 3fa8f72ac113dff073c9a764ba9189abb29ecba7 (diff) | |
download | couchdb-97fdac3af36c378a3fe634942c3ac76e785f16de.tar.gz |
mango: Fix specification of `choose_best_index/1`
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
Diffstat (limited to 'src/mango')
-rw-r--r-- | src/mango/src/mango_cursor_view.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mango/src/mango_cursor_view.erl b/src/mango/src/mango_cursor_view.erl index a784cf6b0..a8a255f72 100644 --- a/src/mango/src/mango_cursor_view.erl +++ b/src/mango/src/mango_cursor_view.erl @@ -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()}), |