kol
kol

Reputation: 106

Specify port number and content database for a query in marklogic

I am writing few test cases in test server 8062, but my data resides on port number 8060 with a specific content database.Without changing the content db of test server using the admin console, is it possible to specify which port and content db to hit for a specific query? Also I do not want to load the contents of content db to test server db. For e.g. something like:

 let $current := (fn:count(cts:uri-match("*.xml*")),(),
    <options xmlns="xdmp:eval">
    <database>{xdmp:database("prj-content")}</database>
    </options>) 

Upvotes: 0

Views: 132

Answers (1)

Justin Makeig
Justin Makeig

Reputation: 2137

In MarkLogic the data doesn't "reside" on a port. Rather an app server that's connected to a database listens on a port for HTTP or XDBC requests. You can have many app servers fronting the same database. Testing and administration are two good use cases for more than one app server configured for a database.

Your test server (port 8062) should specify your prj-content database. What is its current database configuration? Why is that different than prj-content. If you do that, you won't have to specify the database at runtime.

If you really do need to specify the database at runtime you can use xdmp:eval, xdmp:invoke, or xdmp:invoke-function.

Upvotes: 4

Related Questions