ModifyPlan.prototype.remove( [removeCol as String] ) 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. 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. |
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();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.