英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论