op.remove( [removeCol as Object] ) 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. This can also be an object of uri column with 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();
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.