Changes

Jump to navigation Jump to search
No change in size ,  13:32, 20 July 2022
m
Text replacement - "db:pre(" to "db:get("
* {{Code|doc('factbook')}}, read-locking of "factbook"
* {{Code|collection('db/path/to/docs')}}, read-locking of "db"
* {{Code|delete nodes db:preget('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:preget($db)}}
* {{Code|doc(doc('test')/reference/text())}}
* <code>let $db := 'test' return insert nodes <test/> into db:preget($db)</code>
The functions {{Code|fn:doc}} and {{Code|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:doc}} is used instead of {{Code|fn:doc}}.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu