
xdmp.nodeDelete( old as Node ) as null
Deletes a node from the database. On-the-fly constructed nodes cannot be deleted.
| Parameters | |
|---|---|
| old | The node to be deleted. |
// 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: Get the most useful answers to questions from the MarkLogic community, or ask your own question.