Changes

Jump to navigation Jump to search
3 bytes removed ,  20:56, 19 July 2022
m
Text replacement - "db:open" to "db:pre"
* {{Code|doc('factbook')}}, read-locking of "factbook"
* {{Code|collection('db/path/to/docs')}}, read-locking of "db"
* {{Code|delete nodes db:openpre('test')//*[string-length(local-name(.)) > 5]}}, write-locking of "test"
* {{Code|fn:sum(1 to 100)}} (no lock)
A global lock will be assigned if the name of the database is not a static string:
* {{Code|for $db in ('db1', 'db2') return db:openpre($db)}}
* {{Code|doc(doc('test')/reference/text())}}
* <code>let $db := 'test' return insert nodes <test/> into db:openpre($db)</code>
The functions [[Databases#XML Documents|fn:doc]] and [[Databases#XML Documents|fn:collection]] can also be used to address that are not stored in a database. However, this may lead to unwanted locks, and you have two options to reduce the number of locks: No database lookups will take place if {{Option|WITHDB}} option is disabled, or if {{Function|Fetch|fetch:xml}} is used instead of [[Databases#XML Documents|fn:doc]].
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu