Changes

Jump to navigation Jump to search
531 bytes added ,  20:52, 19 July 2022
no edit summary
=Read Operations=
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|db:open}}). The old function will be available for some more time. ==db:openget==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:openget|$db as xs:string|document-node()*}}<br />{{Func|db:openget|$db as xs:string, $path as xs:string|document-node()*}}
|-
| '''Summary'''
| '''Examples'''
|
* {{Code|db:openget("'docs"')}} returns all documents from the database named {{Code|docs}}.* {{Code|db:openget("'db"', "'one"')}} returns all documents from the database named {{Code|db}} located in the path {{Code|one}}.* <code>for $i in 1 to 3 return db:openget("'db" ' || $i)//item</code> returns all item elements from the databases {{Code|db1}}, {{Code|db2}} and {{Code|db3}}.
|}
==db:openget-pre== {{Announce|Updated with Version 10:}} Renamed (before: {{Code|db:open-pre}}).
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:openget-pre|$db as xs:string, $pres as xs:integer*|node()*}}
|-
| '''Summary'''
| '''Examples'''
|
* {{Code|db:openget-pre("docs", 0)}} returns the first database node from the database named {{Code|docs}}.
|}
==db:openget-id== {{Announce|Updated with Version 10:}} Renamed (before: {{Code|db:get-id}}).
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:openget-id|$db as xs:string, $ids as xs:integer*|node()*}}
|-
| '''Summary'''
<syntaxhighlight lang="xquery">
let $target := '/home/john/xml/target'
for $doc in db:openget('DB', 'collection')
let $path := $target || db:path($doc)
return (
'factbook',
map:merge(
for $country in db:openget('factbook')//country
return map:entry($country/@name, $country//city/name ! string())
),
* Added: {{Function||db:get}}, {{Function||db:put}}, {{Function||db:type}}.
* Added: [[#Backups|Backups]]: Support for general data ([[User Management|registered users]], [[Jobs Module#Services|scheduled services]] and [[Store Module|key-value stores]]).
* Updated: {{Function||db:putget}}, {{Function||db:get-id}}, {{Function||db:get-pre}} renamed (before: {{Code|db:open}}, {{Code|db:open-id}}, {{Code|db:open-pre}} and )* Updated: {{Function||db:put-binary}} renamed (before: {{Code|db:replace}} ); function signature aligned with {{Function||db:add}} (second and third argument swapped).* Updated: {{Function||db:put-binary}} renamed (before: {{Code|db:store}}); function signature aligned with {{Function||db:add}} (second and third argument swapped).
* Updated: {{Function||db:get-binary}} renamed (before: {{Code|db:retrieve}}).
* Updated: {{Function||db:backups}}, {{Function||db:create-backup}}: Options added.
;Version 9.3
* Added: {{Function||db:alter-backup}}
* Updated: {{Function|Code|db:open-id}}, {{Function|Code|db:open-pre}}: support for multiple integers
;Version 9.2
;Version 7.0
* Added: {{Function||db:exists}}, {{Code|db:retrieve}}, {{Code|db:store}}, {{Code|db:is-raw}}, {{Code|db:is-xml}}
* Updated: {{Function||db:list}}, {{Function|Code|db:open}}, {{Function||db:add}}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu