Hi, With a trigger defined as in the current Api Documentation (trgr:create-trigger())
> xquery version "1.0-ml"; > import module namespace trgr="http://marklogic.com/xdmp/triggers" at > "/MarkLogic/triggers.xqy"; > > trgr:create-trigger( > "myTrigger", > "Simple trigger example", > trgr:trigger-data-event( > trgr:directory-scope("/myDir/", "1"), > trgr:document-content("modify"), > trgr:post-commit() > ), > trgr:trigger-module(xdmp:database("test"), "/modules/", "log.xqy"), > fn:true(), > xdmp:default-permissions() > ) If a change is change is done on a document under 'myDir' directory, then the modules log.xqy is triggered. This is just fine. But if we add any of these documents to a collection (any collection), this trigger is handle too. I don't understand why ? Adding a document to a collection doesn't change the document content. This just some kind of metadata. Why doesn't collection acts as properties for this use case ? Adding a property to a collection doesn't handle the trigger. And if you wan't so, then use trgr:property-content constraint. The problem is that when the module is triggered I can't guess if it is because content update (the case I wan't to work on) or if someone just add this document to a collection (I don't care for this use case). Could someone provide me information on this case ? Thanks Stéphane _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
