Kelly, Le 1 oct. 2010 à 16:31, Kelly Stirman a écrit :
> What is the logic for determining that the document has not changed? Briefly, I have a process where documents (spectacles) are uploaded once a week. Documents may be new, updated (content changes) or same as before (it's a client process I can't change that). So I try to answer this question : Do not update (do not commit) the document if, for instance, the content as not change. Because I need then to reexport only documents that have really had changes (to reduce traffic and useless processing) based on the last-modified property. > I think you could put the logic into your insert. Something like: > > if(xdmp:exists(doc($uri)) > then > if(xdmp:md5($new) ne xdmp:md5(doc($uri))) > then xdmp:document-insert($uri,$new-doc) > else () > else xdmp:document-insert($uri,$new-doc) > > That will slow down your loads, but it should be faster than using a trigger. The point is that the insert code in within a java application, calling MarkLogic through XDBC connector. I don't want this feature being apply everywhere but for this case, so I though that the trigger approach was smart. Maybe it's a bad parallel but it's a feature really easy to achieve with a stockproc (that I see like trigger in nosql world) because we have an access to OLD and NEW value. So I miss something equivalent. Let me know if my comprehension is confusede. Thanks Stéphane _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
