You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2015/09/10 02:34:12 UTC

[10/26] couchdb-mango git commit: Fix $size operator

Fix $size operator

The convert function was missing an array reference "[]" in the path.

BugzID: 46731


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/85f8a2b6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/85f8a2b6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/85f8a2b6

Branch: refs/heads/master
Commit: 85f8a2b607a74b4abf4e78f0fb93b3becff9c0ad
Parents: e80608d
Author: Tony Sun <to...@cloudant.com>
Authored: Tue Aug 25 13:28:32 2015 -0700
Committer: Tony Sun <to...@cloudant.com>
Committed: Tue Aug 25 13:28:32 2015 -0700

----------------------------------------------------------------------
 src/mango_selector_text.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/85f8a2b6/src/mango_selector_text.erl
----------------------------------------------------------------------
diff --git a/src/mango_selector_text.erl b/src/mango_selector_text.erl
index 5eb237f..b7d78e4 100644
--- a/src/mango_selector_text.erl
+++ b/src/mango_selector_text.erl
@@ -71,7 +71,7 @@ convert(Path, {[{<<"$all">>, Args}]}) ->
         _ ->
             % Otherwise the $all operator is equivalent to an $and
             % operator so we treat it as such.
-            convert([<<"[]">>| Path], {[{<<"$and">>, Args}]})
+            convert([<<"[]">> | Path], {[{<<"$and">>, Args}]})
     end;
 
 % The $elemMatch Lucene query is not an exact translation
@@ -151,7 +151,7 @@ convert(Path, {[{<<"$regex">>, _}]}) ->
     field_exists_query(Path, "string");
 
 convert(Path, {[{<<"$size">>, Arg}]}) ->
-    {op_field, {make_field(Path, length), value_str(Arg)}};
+    {op_field, {make_field([<<"[]">> | Path], length), value_str(Arg)}};
 
 % All other operators are internal assertion errors for
 % matching because we either should've removed them during