Changes

Jump to navigation Jump to search
6 bytes added ,  23:43, 20 May 2013
* {{Code|db:open("docs")}} returns all documents from the database named {{Code|docs}}.
* {{Code|db:open("docs", "one")}} returns all documents from the database named {{Code|docs}} in the subpath {{Code|one}}.
|}
 
==db:open-id==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:open-id|$db as xs:string, $id as xs:integer|node()}}
|-
| '''Summary'''
|Opens the database {{Code|$db}} and returns the node with the specified {{Code|$id}} value.<br />Each database node has a ''persistent'' [[Node Storage#ID Value|ID value]]. Access to the node id can be sped up by turning on the [[Options#UPDINDEX|UPDINDEX]] option.
|-
| '''Errors'''
|{{Error|BXDB0002|XQuery Errors#BaseX Errors}} The addressed database does not exist or could not be opened.<br/>{{Error|BXDB0009|XQuery Errors#BaseX Errors}} the specified id value does not exist in the database.
|}
|-
| '''Summary'''
|Opens the database {{Code|$db}} and returns the node with the specified {{Code|$pre}} value.<br/>The [[Node Storage#PRE Value|pre value]] provides very fast access to a an existing database node in constant time, but it will change whenever a node with a smaller ''pre'' values is added to or deleted from a database.
|-
| '''Errors'''
|}
==db:nodeopen-id==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:nodeopen-id|$nodes db as xs:string, $id as xs:integer|node()*|xs:integer*}}
|-
| '''Summary'''
|Returns Opens the ''id'' values of database {{Code|$db}} and returns the node with the nodes supplied by specified {{Code|$nodesid}}, which must all be [[#Database Nodes|database nodes]]value.<br/>Each database node has a ''persistent'' [[Node Storage#ID Value|ID value]]. Access to the node id can be sped up by turning on the [[Options#UPDINDEX|UPDINDEX]] option.
|-
| '''Errors'''
|{{Error|BXDB0001BXDB0002|XQuery Errors#BaseX Errors}} The addressed database does not exist or could not be opened.<br/>{{CodeError|$nodesBXDB0009|XQuery Errors#BaseX Errors}} contains a node which is the specified id value does not stored exist in a the database.
|}
|-
| '''Summary'''
|Returns the ''pre'' values of the nodes supplied by {{Code|$nodes}}, which must all be [[#Database Nodes|database nodes]].<br/>The [[Node Storage#PRE Value|PRE value]] provides very fast access to a an existing database node in constant time, but it will change whenever a node with a smaller ''pre'' values is added to or deleted from a database.
|-
| '''Errors'''
|
* {{Code|db:node-pre(doc("input"))}} returns {{Code|0}} if the database {{Code|input}} contains a single document.
|}
 
==db:node-id==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:node-id|$nodes as node()*|xs:integer*}}
|-
| '''Summary'''
|Returns the ''id'' values of the nodes supplied by {{Code|$nodes}}, which must all be [[#Database Nodes|database nodes]].<br/>Each database node has a ''persistent'' [[Node Storage#ID Value|ID value]]. Access to the node id can be sped up by turning on the [[Options#UPDINDEX|UPDINDEX]] option.
|-
| '''Errors'''
|{{Error|BXDB0001|#Errors}} {{Code|$nodes}} contains a node which is not stored in a database.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu