Loading TOC...


Comment.data as String


This is inherited from the CharacterData object.

The character data.



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


The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • Hi please have a look at the following code How to remove the rest-reader and rest-writer entire permissions on a particular document (How to delete their roles on a particular doc ) as the marklogic.patchBuilder.remove('role-name'); would not work on rest-reader and rest-writer roles? var marklogic=require('marklogic'); var conn=require('./connection.js'); var inst=marklogic.createDatabaseClient(conn.student); var ins=marklogic.createDatabaseClient(conn.admin); ins.documents.write({ 'uri' : '/test/exam.json', 'content' : { 'id' : 'AX456GH', 'status' : 'active' }, 'permissions' : [ { 'role-name' : 'rest-reader', 'capabilities' : ['read'] } ], 'collections' : ['confidential','readonlyme'], }).result(function(res){ console.log('Document written with URI '+res.documents[0].uri); var pb=marklogic.patchBuilder; ins.documents.patch({ 'uri' : '/test/exam.json', 'categories' : ['metadata'], 'operations' : [ pb.permissions.replace({'role-name': 'rest-writer','capabilities' : ['read']}) pb.permissions.remove('rest-reader'); //Not Working ] }); console.log(res); console.log(res.documents[0].uri); //console.log(res.documents[0].permissions); // console.log(res.documents[0].collections); },function(err){ console.log(JSON.stringify(err,null,2)); })