You can do it by concatenating the string that gets passed:
let $skip := 10
return cts:uris("", ("limit=10", "skip=" || $skip),
cts:collection-query("sample-docs"))
--
Dave Cassel, @dmcassel<https://twitter.com/dmcassel>
Technical Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
http://developer.marklogic.com/
From:
<[email protected]<mailto:[email protected]>>
on behalf of Matt Moody
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Thursday, August 24, 2017 at 3:24 PM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] How to pass variable to limit or skip option
in cts:uris ?
I’m struggling with this simple scenario…
How do I pass a variable to the limit and skip options in cts:uris ?
I’ve tried all sorts of ways to pass in $skip, but always receive the Invalid
option error.
let $skip := 10
return cts:uris("", ("limit=10", "skip=($skip)"),
cts:collection-query(“sample-docs”))
this is getting…
[1.0-ml] XDMP-OPTION: cts:uris("", ("limit=10", "skip=($skip)"),
cts:collection-query("sample-docs")) -- Invalid option "skip=($skip)"
Thanks!
-Matt Moody
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general