[MarkLogic Dev General] xdmp:collection-delete()
palanitt at gmail.com
Wed Mar 7 13:10:11 PST 2012
Yes, I did verify the count of the the collection "Test" using
count(fn:collection("Test")) and it was 50.
Below is the code that I was using to move the doc uris to "Test"
let $result := for $i in cts:uri-match("/localhost/userid/*")[1 to 51]
let $insert-collections:= xdmp:document-set-collections($i,
Since, I used the cts:uri-match(), the first doc uri that gets set in the
"Test" collection will be "/localhost/userid/" and this was the reason for
deletion of all the records under that folder when I tried to do
Thanks for extending your help!
On Wed, Mar 7, 2012 at 3:14 PM, Geert Josten <geert.josten at dayon.nl> wrote:
> Hi Palani,
> Sure only 50 docs had been added to that collection? You can test that
> easily using count(collection(“Test”)), or for a bit more speed
> Kind regards,
> *Van:* general-bounces at developer.marklogic.com [mailto:
> general-bounces at developer.marklogic.com] *Namens *Palani TT
> *Verzonden:* woensdag 7 maart 2012 20:10
> *Aan:* general at developer.marklogic.com
> *Onderwerp:* [MarkLogic Dev General] xdmp:collection-delete()
> I am trying to understand the behavior of this function. My requirement
> was to delete the records in a particular collection. I had like 2000
> records under a particular userid/folder. I moved 50 records from that
> userid to a collection named "Test" using xdmp:document-set-collections()
> function. After that, I wanted to delete the collection "Test" by invoking
> the function xdmp:collection:delete(). What happened was all the 2000
> records under that particular userid/folder got deleted when I thought only
> the 50 records were supposed to get deleted. Can anyone please, explain
> this behavior?
> General mailing list
> General at developer.marklogic.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General