Query¶
Executes an XQuery against the repository and returns the results as an array of strings.
$XmlRepository.Query(xquery: string, parameters?: object, collection?: string):Array<string>
Parameters¶
string xquery
The XQuery expression to execute against the database.
object parameters optional
An object containing parameters to bind to the XQuery expression.
string collection optional
The name of the collection to query. If not specified, the domain database is queried.
Returns¶
An array of strings representing the results of the XQuery. Returns an empty array if the query yields no results.
Remarks¶
The examples below demonstrate how to query the domain database.
The query syntax is described in detail on the XQuery standard page.
Query all customer nodes as strings¶
1 2 | |
Query a customer by ID with parameters¶
1 2 3 4 | |
Update a customer name with XQuery¶
1 2 3 | |
Insert a new XML node with XQuery¶
1 2 3 4 | |
Delete a record with an XQuery update¶
1 2 3 4 5 6 7 | |
Info
To query a process database, use the collection keyword and provide the database's GUID.
For process databases, you can obtain the GUID using $Instance.ProcessId.
Query a process database collection¶
1 2 3 4 | |