Loading TOC...

MarkLogic 12 Product Documentation
op.remove

op.remove(
   [removeCol as ColumnIdentifier]
) as ModifyPlan

Summary

This method deletes a document from the database. If the document does not exist, this method does not throw an error.

Parameters
removeCol If this column is not specified then it assumes a column 'uri' is present. The column, which contains URIs, can be named with a string or a column function such as op.col, op.viewCol, or op.schemaCol, or constructed from an expression with the op.as function.

See Also

Example

declareUpdate();
const op = require('/MarkLogic/optic');

op.fromDocDescriptors([{uri:"/test.xml"}])
.remove()
.execute();
  

Example

declareUpdate();
const op = require('/MarkLogic/optic');

op.fromDocDescriptors([{uri:"/test.xml"}])
.remove("uri")
.execute();
  

Example

declareUpdate();
const op = require('/MarkLogic/optic');

op.fromDocDescriptors([{uri:"/test.xml"}],"myQualifier")
.remove(op.viewCol("myQualifier","uri"))
.execute();
  

Example

declareUpdate();
const op = require('/MarkLogic/optic');
const docsDescriptor = [{uri: '/optic/update/remove1.json'}, {uri: '/optic/update/remove2.json'}];
op.fromDocDescriptors(docsDescriptor)
  .remove({uri:'uri'})
  .result();
  

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