Reputation: 931
When executing test code from the query console, is there anyway to import XQuery modules that are located in the modules db? I am assuming that the QueryConsole is set to only load modules from the filesystem, which is why I am getting a module not found when I try to load mine.
I am looking for an easy way to test out the XQuery code that I have written, and what I am doing now is to simply paste the whole code with all the functions across multiple modules into the same query tab in order to test.
Does anyone have any suggestions about how they go about testing their xquery modules for MarkLogic?
Update
I tried with the suggestion below, specifying the content db instead of the modules db. But I still have no success.
And the error I get is:
XDMP-MODNOTFOUND: (err:XQST0059) Module /AbbVie/authorization/lib/authorization.xqy not found
Resolved
When attempting to follow the advice, I loaded the library files into an incorrect path.
Upvotes: 3
Views: 667
Reputation: 1339
Yes, you can import modules with query console. You do this by first changing the content source. This is a drop down on the top left. It shows all the databases. If you have application servers setup it will pair the content database and the modules database that the application servers have. For instance:
Documents (Modules: /, server: App-services)
The first name shows the content database. In between parenthesis you first get the name of the modules database, followed by the modules root. In case of custom app-servers you can also see the name of the app-server after server:
So, for you its probably a matter of picking the correct content source. Once you do that then you just need to import module
to get the correct module. If its a content and module database pair based on an application server it will take the modules root from the application server configuration into account.
Upvotes: 5