Changes

Jump to navigation Jump to search
220 bytes added ,  19:29, 7 December 2013
!Description
|-
|<code>[[Database Module#db:open|db:open()]]</code>
|{{Code|db:open("db", "path/to/docs")}}
|Returns all documents that are found in the database {{Code|db}} at the (optional) path {{Code|path/to/docs}}.
|-
|<code>[http://www.xqueryfunctions.com/xq/fn_collection.html fn:collection()]</code>
|{{Code|collection("db/path/to/docs")}}
|Returns all documents at the location {{Code|path/to/docs}} in the database {{Code|db}}.<br/>If no path is specified after the database, all documents in the database will be returned.<br/>If no argument is specified, all documents of the currently opened database will be returnedthat has been opened in the global context.
|-
|<code>[http://www.xqueryfunctions.com/xq/fn_doc.html fn:doc()]</code>
|{{Code|doc("db/path/to/doc.xml")}}
|Returns the document at the location {{Code|path/to/docs}} in the database {{Code|db}}.<br/>An error is raised if the specified addresses does not address exactly one document.
|}
If the [[Options#DEFAULTDB|DEFAULTDB]] option is turned on, the path argument of the {{Code|fn:doc}} or {{Code|fn:collection}} function will first be matched against the globally opened database. Two more functions are available to extract for retrieving information on database information of a nodenodes:
{| class="wikitable"
Bureaucrats, editor, reviewer, Administrators
12,003

edits

Navigation menu