Result as JSON Structure
The overloaded methods QueryJsonValue in interface JsonQL.Query.IQueryManager can be used to to query one or more JSON files using a JsonQL query expressions and return the result as a JSON structure.
Note
See Query Result Data Structure: JsonQL.Query.IJsonValueQueryResult for more details on data structure used for the result.
The result of a query is stored in an instance of C# interface JsonQL.Query.IJsonValueQueryResult.
- Interface JsonQL.Query.IJsonValueQueryResult has a property CompilationErrors of type JsonQL.Compilation.ICompilationErrorItem that stores data about query execution errors, if any.
Note
The errors might contain both errors in queried files, if queried files use JsonQL expressions (or are not well formed), as well as errors in query itself, or errors encountered when converting result JSON to a C# object.
Interface JsonQL.Query.IJsonValueQueryResult has a property ParsedValue of type JsonQL.JsonObjects.IParsedValue that stores query result as a JSON object.
One ore more JSON files can be specified as parameters to be used when looking up JSON values referenced by JsonQL expressions.
If many JSON files are specified the following rules and techniques are used: - Parent/child relationships between JSON files is maintained and parent JSON files are evaluated before child JSON files are evaluated. - Lookup of JSON values specified in JsonQL expressions starts in JSON containing the expression first, and then in parent JSON files.
Note
- For more examples look at examples at these links:
Note
Querying JSON with result as a JSON structure is pretty similar to querying JSON with result as C# object describes in section Result as C# Object. The query expressions use exactly the same format. The only difference is the format of the result generated by JsonQL. Querying JSON with result as C# object involves conversion from JSON to C# classes provided by the user, and therefore the API is more involved (more ways to configure the conversion process and report errors).