Answering my own question, for the archives...

After more tests, it seems that the JavaScript variable `uri` is
automatically bound.  So the following gives the URI of the document:

var uri;

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 16 April 2016 at 20:20, Florent Georges wrote:
> Hi,
>
> I created a trigger, the module of which is a JavaScript module.  I
> could not find any documentation specific to JavaScript in the context
> of triggers, but creating a trigger the same way as for XQuery, only
> pointing at an SJS module, just works.
>
> But I cannot find a way to retrieve the URI of the document that fired
> the trigger.  In XQuery, this is done by declaring the following
> variable, which is bound by MarkLogic when invoking the trigger:
>
> declare variable $trgr:uri as xs:string external;
>
> Is it possible to do the same in JavaScript?
>
> Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to