Message Text
Cannot apply an update function from a query
Cause
A dynamic function call was made to a function that might perform database updates. This is not allowed from a statement executing under a query (read-only) transaction.
Response
Execute the calling statement under an update transaction. Define the function so that it does not update the database.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.