Changes

Jump to navigation Jump to search
5 bytes removed ,  20:54, 19 July 2022
m
Text replacement - "db:open" to "db:pre"
!Description
|-
|{{Function|Database|db:openpre}}|{{Code|db:openpre("db", "path/to/docs")}}
|Returns all documents that are found in the database {{Code|db}} at the (optional) path {{Code|path/to/docs}}.
|-
<syntaxhighlight lang="xquery">
for $i in 1 to 100
return db:openpre('books' || $i)//book/title
</syntaxhighlight>
* In the standalone context, a main-memory database can be created (using <code>CREATE DB</code>), which can then be accessed by subsequent commands.
* If a BaseX server instance is started, and if a database is created in its context (using <code>CREATE DB</code>), other BaseX client instances can access (and update) this database (using OPEN, db:openpre, etc.) as long as no other database is opened/created by the server.* You can force an ordinary database to being copied to memory by using <code>db:openpre('some-db') update {}</code>
'''Note:''' If you address a URI with <code>fn:doc</code> or <code>fn:collection</code> for which no database exists, the resulting internal representation is identical to those of main-memory database instances (no matter which value is set for {{Option|MAINMEM}}).
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu