Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp.nodeDelete

xdmp.nodeDelete(
   old as Node
) as null

Summary

Deletes a node from the database. On-the-fly constructed nodes cannot be deleted.

Parameters
old The node to be deleted.

Example

//  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);
=>
 /example.json now looks like this:
 {"a":"aa"}

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.