Query¶
Executes an XQuery against the repository and returns the results as an array of strings.
1 | |
Parameters¶
string xquery
The XQuery expression to execute against the database.
object parameters optional
An object containing parameters to bind to the XQuery expression.
Returns¶
An array of strings representing the results of the XQuery. Returns an empty array if the query yields no results.
Remarks¶
The query runs against the domain database. Each property of parameters is bound to the XQuery variable with the same name, for example { id : '42' } binds $id. Parameter values are passed as strings. Bind values with parameters instead of concatenating them into the query text.
The query syntax is described in detail on the XQuery standard page. XQuery failures are surfaced as script errors. Update expressions are executed by the repository, so use this method only when the query is intentionally mutating.
Info
To query a process database, use the collection function in the query and provide the process ID.
For the current process, you can obtain it with $Instance.ProcessId.
Examples¶
Read a value with a parameterized query¶
1 2 3 4 5 | |
Copy query results into the pool data¶
1 2 3 4 5 | |
Update a value with XQuery Update¶
1 2 3 4 5 6 | |
Insert a node with XQuery Update¶
1 2 3 4 5 6 | |
Delete nodes with XQuery Update¶
1 2 3 4 | |
Query the database of the current process¶
1 2 3 | |