
op.remove( [removeCol as ColumnIdentifier] ) as ModifyPlan
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. |
declareUpdate();
const op = require('/MarkLogic/optic');
op.fromDocDescriptors([{uri:"/test.xml"}])
.remove()
.execute();
declareUpdate();
const op = require('/MarkLogic/optic');
op.fromDocDescriptors([{uri:"/test.xml"}])
.remove("uri")
.execute();
declareUpdate();
const op = require('/MarkLogic/optic');
op.fromDocDescriptors([{uri:"/test.xml"}],"myQualifier")
.remove(op.viewCol("myQualifier","uri"))
.execute();
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: Get the most useful answers to questions from the MarkLogic community, or ask your own question.