Tutorial by Examples

This very simple snippet of XQuery can be executed in QueryConsole using the built-in "Documents" database as a sandbox. Each piece of the snippet has a comment to explain what the following line of code means. xquery version "1.0-ml"; (: Let's first insert a simple document to...
If we know the desired URI of the document we are looking for: fn:doc("/stuff/mysimpledocument.xml") Returns the full document from the database, using the URI to locate it. Since this is XQuery, we can use XPath to find the document when we know about the structure, but not the URI: ...
We will now add some additional XML nodes to the "my-document" element and update the document. The snippet again contains comments to explain what is happening. xquery version "1.0-ml"; (: We are preserving the same URI as we used originally :) let $uri := "/stuff/mysimp...
MarkLogic is first and foremost a search engine, so let's use two different methods to search for this document. Using search:search() This gives a peek into using search:search() to develop search applications. This library provides Google-like search results and will likely speed up your develop...
To round out simple examples of CRUD operations, we present the following examples. Always use great care in deleting documents. (: When we know the URI, we can delete it very easily :) let $uri := "/stuff/mysimpledocument.xml" return xdmp:document-delete($uri) or simplified: xdmp:d...

Page 1 of 1