Loading TOC...

ModifyPlan.prototype.remove

ModifyPlan.prototype.remove(
   [removeCol as Object]
) 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. This can be a string of the uri column name or an op.col. Use op.viewCol or op.schemaCol if you need to identify columns in the two views that have the same column name. This can also be an object of uri column with column name.

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.