|-
| '''Summary'''
|Creates a new database with name {{Code|$db}} and adds initial documents specified via {{Code|$inputs}} to the specified {{Code|$paths}}. An existing database will be overwritten.<br/>:* {{Code|$inputs}} may be strings or nodes different than :** nodes may be of any type except for attributes. If the {{Code|$input}} source is not a ** strings may be file /directory references, or a folder, XML strings (which are detected by the {{Code|$paths}} argument is mandatory.leading <code><<br/code>Please note that {{Code|db:create}} will character)** a path must be placed last on specified if the [[XQuery Update#Pending Update List|Pending Update List]]. As input is not a consequence, a newly created database cannot be addressed in the same query.<br/>file or directory reference* The {{Code|$options}} argument can be used to change the indexing behavior. Allowed :** allowed options are all [[Options#ParsingIndexing|parsingindexing]], and [[Options#XML ParsingFull-Text|XML parsingfull-text]], [[Options#IndexingParsing|indexingparsing]] and [[Options#Full-TextXML Parsing|full-textXML parsing]] options in lower case** parsing options are only applied to string inputs (XML strings or file/directory references)* An existing database will be overwritten. Next, {{Code|db:create}} will be placed last on the [[XQuery Update#Pending Update List|Pending Update List]]. As a consequence, a newly created database cannot be addressed in the same query.
|-
| '''Errors'''
|-
| '''Summary'''
|Adds documents specified by {{Code|$input}} to the database {{Code|$db}} and with the specified {{Code|$path}}. :* A document with the same path may occur more than once in a database. If this is unwantedyou want to enforce single instances, use [[#db:replace|db:replace]] can be usedinstead.<br/>{{Code|$input}} may be a string or a node different than attribute. If * For more information on the {{Code|$input}} source is not a file or a folderarguments, {{Code|$path}} must be specified.<br/>The {{Code|$options}} argument can be used to control parsing. The syntax is identical to the see [[#db:create|db:create]] function. Allowed (note that the specified options are all must not be [[Options#ParsingIndexing|parsingindexing]] and [[Options#XML ParsingFull-Text|XML parsingfull-text]] options in lower case).
|-
| '''Errors'''
|-
| '''Summary'''
|Replaces a document, specified by {{Code|$path}}, in the database {{Code|$db}} with the content contents of {{Code|$input}}, or adds it as a new document.<br/>The {{Code|$options}} argument can be used to control parsing. The syntax is identical to the :* See [[#db:createadd|db:create]] function: Allowed options are all [[Options#Parsing|parsingadd]] for more details on the arguments (for historical reasons, the order of the 2nd and [[Options#XML Parsing|XML parsing]] options in lower case3rd argument differs).
|-
| '''Errors'''