<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.nodeDelete.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.nodeDelete</api:function-name><api:suggest>xdmp.nodedelete</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>nodedelete</api:suggest><api:function-link mode="xquery" fullname="xdmp:node-delete">/apidoc/8.0/xdmp:node-delete.xml</api:function-link><api:function mode="javascript" name="nodeDelete" type="builtin" lib="xdmp" category="UpdateBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.nodeDelete"><api:summary>
  Deletes a node from the database.
  On-the-fly constructed nodes cannot be deleted.
</api:summary><api:params><api:param name="old" type="node()"><api:param-description>
    The node to be deleted.
  </api:param-description><api:param-name>old</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>null</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
//  assume a document created with:
//    declareUpdate();
//    xdmp.documentInsert("/example.json",
//    {"a":"aa","b":"bb"});
//
declareUpdate();
for (var x of fn.doc("/example.json") )
xdmp.nodeDelete(x.root.b);
=&gt;
 /example.json now looks like this:
 {"a":"aa"}
</pre></api:example></api:function></api:function-page>