summaryrefslogtreecommitdiff
path: root/src/mango
diff options
context:
space:
mode:
authorGabor Pali <gabor.pali@ibm.com>2023-02-16 02:57:24 +0100
committerNick Vatamaniuc <nickva@users.noreply.github.com>2023-02-15 22:14:19 -0500
commit97fdac3af36c378a3fe634942c3ac76e785f16de (patch)
treeadc17ab191d1b88e60bd251e2bb3ac1deb023717 /src/mango
parent3fa8f72ac113dff073c9a764ba9189abb29ecba7 (diff)
downloadcouchdb-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.erl3
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()}),