I have a requirement where I have to set collection to the existing documents. The thing is I have around 20 million records. I am running below query from query console. It is throwing time out error. I also tried out limit=N option in below query. At max I was able to achieve N=40000, after that it's again throwing time out error. Please help me with any faster query or approach.
for $each in cts:uri-match("/data/employee/*")
return xdmp:document-set-collections($each, "employee")