当使用AQL中的IN运算符时,stats.FullCount的值是错误的。

huangapple go评论74阅读模式
英文:

Value of stats.FullCount is wrong when AQL IN operator is used

问题

ArangoDB3-3.7.2_win64
arangodbJavaDriver=6.7.5

假设集合中有超过100个文档,通过Java驱动程序使用AqlQueryOptions().fullCount(true)执行以下AQL查询,可以在stats.fullCount中返回预期的值:

FOR a IN SomeCollection FILTER a.field = @p1 SORT a.field ASC LIMIT 0,100 RETURN a

但是,使用IN运算符的类似查询,stats.fullCount的值意外地为100:

FOR a IN SomeCollection FILTER a.field IN [@p1, @p2] SORT a.field ASC LIMIT 0,100 RETURN a

奇怪的是,当我降级到ArangoDB3-3.6.3_win64时,这两个查询都按预期工作,并在stats.fullCount中返回正确的值。

是否可以恢复正确的功能?

英文:

ArangoDB3-3.7.2_win64
arangodbJavaDriver=6.7.5

Assuming collection has more than 100 documents, the following AQL query through the Java driver using AqlQueryOptions().fullCount(true) returns the expected values in stats.fullCount:

FOR a IN SomeCollection FILTER a.field = @p1 SORT a.field ASC LIMIT 0,100 RETURN a

But a similar query using the IN operator the value of stats.fullCount is unexpectedly 100:

FOR a IN SomeCollection FILTER a.field IN [@p1, @p2] SORT a.field ASC LIMIT 0,100 RETURN a

Oddly, when I downgrade to ArangoDB3-3.6.3_win64 both queries work as expected and return the correct value in stats.fullCount

Can the correct functionality be restored?

答案1

得分: 1

在AQL中,等号操作符是==,而=表示赋值操作符。因此,您的第一个查询应该类似于:

FOR a IN SomeCollection FILTER a.field == @p1 SORT a.field ASC LIMIT 0,100 RETURN a
英文:

Equality operator in AQL is ==, while = is the assignment operator. So your first query should be like:

FOR a IN SomeCollection FILTER a.field == @p1 SORT a.field ASC LIMIT 0,100 RETURN a

huangapple
  • 本文由 发表于 2020年10月8日 06:24:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/64253148.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定