To make the ML-8 bi temporal documents updatable in ML-9, we will need to add new metadata "temporalDocURI" to the existing document URI where we want to make the update.
Sample Code:
let $uri := "/documents/test.xml"
return xdmp:document-put-metadata(
$uri,map:map(<map:map xmlns:map="http://marklogic.com/xdmp/map">
<map:entry key="temporalDocURI">
<map:value>{$uri}</map:value>
</map:entry>
</map:map>))
Once the metadata is added to the bitemporal document which we want to update, the temporal apis for node update or insert will work for all documents inserted prior to ML-9.
Note In order for the 'xdmp:document-put-metadata' API to work on temporal documents, it will need override privilege for the temporal collection the temporal document belongs to, and if the user making the change is not an admin user, then granular execute privilege needs to be added for the user and then perform the 'xdmp:document-put-metadata'.