if an object provides a toJSON() function, this function is still called for serializing it.
the change is that the result of toJSON() is not stringified anymore, but saved as is. previous
versions of ArangoDB called toJSON() and after that additionally stringified its result.
make the AQL query optimizer inject filter condition expressions referred to by variables during filter condition aggregation
for example, in the following query
FOR doc IN collection
LET cond1 = (doc.value == 1)
LET cond2 = (doc.value == 2)
FILTER cond1 || cond2
RETURN { doc, cond1, cond2 }
the optimizer will now inject the conditions for `cond1` and `cond2` into the filter condition `cond1 || cond2`, expanding it to
`(doc.value == 1) || (doc.value == 2)` and making these conditions available for index searching.
note that the optimizer previously already injected some conditions into other conditions, but only if the variable that defined
the condition was not used elsewhere. for example, the filter condition in the query
FOR doc IN collection
LET cond = (doc.value == 1)
FILTER cond
RETURN { doc }
already got optimized before because `cond` was only used once in the query and the optimizer decided to inject it into the place
where it was used.
this only worked for variables that were referred to once in the query. when a variable was used multiple times, the condition
was not injected as in the following query
FOR doc IN collection
LET cond = (doc.value == 1)
FILTER cond
RETURN { doc, cond }
the fix for #2070 now will enable this optimization so that the query can use an index on `doc.value` if available.