On 12/02/2024 18:03, Deepak Dinakara wrote:


Similarly I also want to execute queries against a list of collections using regex.
Something like "for $document in collection('db-name/20230*')" (First 9 months of 2023)
Right now, I am doing something like 
"for $i in ('01', '02', '03', '04', ... '09')
for $document in collection('test-collection/2023' || $i)"
But if there are better ways, kindly let me know.

That one could at least use "to" e.g.

  for $i in (1 to 9)!format-integer(., '01')

Not sure that is an improvement, decide for yourself.