There are a few update operations you can issue in the same transaction when 
performing xdmp:document-insert():

let $uri := "/my-doc2.xml"
let $doc := <doc>foo</doc>
let $properties := <myproperty>bar</myproperty>
return (
  
xdmp:document-insert($uri,$doc),xdmp:document-set-properties($uri,$properties),
  xdmp:document-add-collections($uri,"my-collection"),
  xdmp:document-add-permissions($uri,xdmp:permission("admin","read"))
);
let $uri := "/my-doc2.xml"
return (
  doc("/my-doc2.xml")/property::*,
  xdmp:document-get-permissions($uri),
  xdmp:document-get-collections($uri)
)

Kelly
 

In response to a post or newAdhocQuery, I will need to insert the document
and add the properties.  I wish there was an option for adding document
properties when performing an xdmp-document-insert().  My pan is to have the
insert to kick off a pipeline which may not yet have the necessary
properties associated with it because a subsequent
xdmp:document-add-properties() would be required after the insert.  I don't
think I can wrap the insert and the add-properties into a transaction
because the document probably won't be available to add the properties until
after the transaction completes.  

 

Tim


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to