Hi Geert,

> So we were right about all except that the eval or invoke should be run 
> against the database that actually stores the triggers, not the documents 
> database, as is stated on top of Triggers documentation:
>
> http://developer.marklogic.com/pubs/4.1/apidocs/Triggers.html,
>
> "The trigger functions should all be run against the triggers database for 
> the database in which the content is stored."

Yeah - that's the reason for using eval/invoke, so that you always run
the trigger creation against the triggers database:

let $query := 'your trigger creation code'

return (xdmp:eval($query, (), <options xmlns="xdmp:eval">
   <database>{xdmp:database('the-triggers-db')}</database>
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 </options>), 'Done')


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to