[MarkLogic Dev General] How can I set the
documentpropertieswhen inserting a document with the XCC?
Geert Josten
Geert.Josten at daidalos.nl
Tue Oct 6 10:18:54 PDT 2009
> Thanks Geert, it's a great idea. The idea of using an HTTP
> post as you suggested in the other related XCC topic is also
> interesting.
>
> 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
You need not worry. Just put the xdmp:document-insert and the xdmp:document-add-properties in a single newAdhocQuery call. That should work just fine.
Each newAdhocQuery is treated as a single transaction in its whole (unless you deliberately specify multiple queries in one query string, separating them with semi-colons).
When in doubt: test the query in CQ and you will notice soon enough whether it will work properly or not. There is no significant difference between running queries from XCC, versus running them from CQ..
Kind regards,
Geert
Drs. G.P.H. Josten
Consultant
http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
More information about the General
mailing list