xquery - How to rename a document in MarkLogic? -


i have simple task unable find exact solutions this.i have saved file abc.xml in marklogic.how can rename file example.xml using xquery?

code tried:

xquery version "1.0-ml"; xdmp:document-rename ("/aaa.xml","/final.xml"); 

this showing error.

there no way, know of, change document uri of existing document. way can think of create new document same content , new uri, , delete existing one, in same transaction.

where gets tricky make sure preserve ownership, permissions, properties, property document, make sure old uri not used anywhere link existing document, etc.

but usually, document uri never used. should first considering whether need rename document, , why.

(note saying "this showing error" useful on or on mailing lists, if not show error is.)


Comments