Loading TOC...

spell.insert

spell.insert(
   $uri as String,
   $dict as element(spell.dictionary) | Object | objectNode()
) as null

Summary

Load the words in $dict into the dictionary at $uri. If there is no document at $uri a new one will be created. If there is a document at $uri it will be overwritten.

Parameters
$uriThe URI of the dictionary.
$dict A dictionary document which can be an xml element, a javascript object or a json object-node.

Example

  var spell = require("/MarkLogic/spell");
  declareUpdate();

  spell.insert("/mySpell/special.json", {"words":["WebDAV"]})

  => Creates a dictionary with only the word "WebDAV" 
     at the specified URI
  

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy