Hi Manoj,

It is possible to create a pre-commit trigger to do this.  That trigger could, 
for example, check your pre-conditions and, if they are not satisfied, throw an 
error, which would cause the transaction to fail.

Is that what you had in mind?

You could also put that logic in your module that loads the document and avoid 
using a pre-commit trigger.

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Manoj
Sent: Wednesday, August 10, 2011 1:59 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] How to validate a document before inserting in 
the DB

Hi All,
   We have a requirement where in a common service will keep loading documents 
into 2 ML DB through xcc. We need to allow only some of the documents to be 
loaded in the 2nd DB based on certain conditions. Is it possible to check for 
these condition when the service is trying to load the document into the DB. I 
mean something like before-insert trigger or some other approach using which we 
can stop the document from loading if it fails certain condition. The condition 
are not static.

Thanks & Regards
Manoj
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to