Hi all, I'm trying to use the REST API to call server-side XQuery scripts. As I understand it, these scripts are not part of a database, but reside in the filesystem where BaseX is "installed" (or where RESTPATH points to).
However, when I execute an XQuery I would like it to run on a particular database. Is there anyway to achieve this without passing the database as an argument to the query? For example, http://localhost:8984/rest?run=find.xq http://localhost:8984/rest/Test?run=find.xq ... both execute the same query, and that query needs to open a database to do its searching, so currently the database to open is hard-coded. It would be nice if the query could work out what database or "collection" was its context and automatically use that. Additionally, if I do http://localhost:8984/rest?run=Test/find.xq ... then I run the query that is in the Test folder, but this still does not have any context and so still needs to know to open the Test database. Is there a way to achieve this without having to pass the name of the database to every XQuery? Or am I not understanding things and is there a better way to do this sort of thing? Thanks, Luke