Hello Martin,

as stated in our documentation at http://docs.basex.org/wiki/Databases#XML_Documents you can further restrict the documents in the collection via the argument.

Also, you can get all document names in a database using db:list("database") or even stricter using a path, e.g. db:list("database", "my/path").

Cheers
Dirk

On 08/28/2015 06:35 PM, Martín Ferrari wrote:
Hello:
    I wonder if there's a fast way to get the contents or names of the resources that start with a certain path. We have something like this:

            string query = @"for $doc in collection()
                             where substring-after(document-uri($doc), '/') = '" + documentName + @"'
                             return $doc/Root";

    But our db has millions of resources so this doesn't scale too well.
    I'd like a way to get the contents (or names) of resources in which the names start with a certain pattern without having to check all names. Is it possible?

     The alternative would be to add a field inside the xml resources, index on it, and perform a query.

Thanks,
     Martín.



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22