Hi Danny,

Try using the –document_selector option.  It seemed to do the trick in a small 
test based on your use case and sample xquery. You’ll have to figure out the 
$date-one-day-ago before invoking it.

Example:


mlcp.sh export -host localhost -port 7003 -username kefo -password admin -mode 
local -output_file_path export/ -document_selector 
'/*:mets[property::prop:last-modified[.>xs:dateTime("2015-01-23T09:55:22-06:00")]]’


HTH,

Kevin



From: Danny Sinang <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Thursday, January 22, 2015 at 9:26 AM
To: general 
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Can MLCP use an input query ?

We're considering using MLCP to replace XQSync and it seems MLCP is up to the 
job except that it doesn't accept an INPUT_QUERY parameter.

In XQSync, we use the following query to fetch all docs whose last-modified 
property is older than 1 day.

INPUT_QUERY=declare variable $date-one-day-ago  := fn:current-dateTime() - 
xs:dayTimeDuration("P1D"); for $d in cts:search(/, cts:and-query( ( 
cts:not-query(cts:directory-query('/events/', 'infinity')), 
cts:properties-query(cts:element-range-query(xs:QName("prop:last-modified"), 
">", $date-one-day-ago)) ) ) ) let $uri := xdmp:node-uri($d) order by $uri 
return $uri


But in MLCP, it appears the only way to selectively choose which docs to copy 
would be by copying entire collections, directories, or by specifying an XPATH 
expressions - none of which allow me to use a query.

Is there a workaround for this ?

Regards,
Danny


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

Reply via email to