Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
json-api: field equality query, with nesting #2778
Building on #2777 .
Unless otherwise required by one of the other rules below or to follow, values are interpreted according to the #2519 definition of LF values' JSON format, and compared for equality.
Match documents having at least all the (potentially nested) keys expressed in the query. The result document may contain additional properties.
A JSON object, when considered with a record type, is always interpreted as a field equality query. Its type context is thus mutually exclusive with #2780.
This is not a JSON query language, it is a DAML LF query language. So, while we could theoretically treat queries (where not otherwise interpreted by the "may contain additional properties" rule above) without concern for what LF type (i.e. template) we're considering, we will not do so.
Consider the subquery
In the cases of
Additionally, it would be extremely easy to overlook unintended meanings of queries when writing them, and impossible in many cases to suppress those unintended meanings within the query language. For example, there is no way that the above query could be written to match
For these reasons, as with LF value input via JSON, queries written in JSON are also always interpreted with respect to some specified LF types (e.g. template IDs). As #2777 implies, for example:
The above "Typecheck failure" happens because there is no LF type to which both