I want to query marklogic for the documents which have been updated in last 3 minutes in a collection.
I have tried to write a structured query for the requirement but its accepting only hard-coded value for dateTime and not fn:current-dateTime() function. Below is what i tried.
<query xmlns="http://marklogic.com/appservices/search">
<and-query>
<collection-query>
<uri>live</uri>
</collection-query>
<range-query type="xs:dateTime">
<element ns="" name="created-on"/>
<value>2019-06-10T10:36:14.002101Z</value>
<range-operator>GT</range-operator>
</range-query>
</and-query>
</query>
I expect something like this -
<query xmlns="http://marklogic.com/appservices/search">
<and-query>
<collection-query>
<uri>live</uri>
</collection-query>
<range-query type="xs:dateTime">
<element ns="" name="created-on"/>
<value>{fn:current-dateTime() - xs:dayTimeDuration("PT3M")}</value>
<range-operator>GT</range-operator>
</range-query>
</and-query>
</query>